hello all
i have been researching and trying different ways to add a textbox and label by a button click but i have been having nothing but issues. I am currently working on a website where i can add a new text field with a label with a click.
once i have this working i am going to have it so i can have multiple tables in a database so a user can have multiple phone numbers.
im using a table of phone numbers with a ID that will connect to a user in the main table. I am using phpmyadmin to store the data.
Here is what i have i know i have to be close but dont see where i went wrong.
<script type="text/javascript" language="JavaScript">
function NewPhoneData()
{
}
After i can add a new field here is my php code so far maybe people can point me in the direction how to add data to multiple tables at once
if (empty($_POST['homePhone']))
{
echo 'ERROR: Please enter a valid employee name';
$inputError = true;
}
else
{
$homePhone = $mysqli->escape_string($_POST['areaHome'] . $_POST['homePhone']);
}
if ($inputError != true)
{
$sql = "INSERT INTO people (address, email, firstName, lastName, mainPhone)
VALUES ('$address', '$email', '$fName', '$lName', '$homePhone')";
if ($mysqli->query($sql) === true)
{
echo 'New employee record added with ID: ' . $mysqli->insert_id;
}
else
{
echo "ERROR: Could not execute query: $sql. " . $mysqli->error;
}
}
Thank you for your time