First - I appreciate the help I have received here - a lot! (Just in case I haven't said so.)
I am a student 11 weeks into a PHP/MySQL college class. The following week is spring break (no teacher) and I am working on my 'final project'.
I'm dealing with a registration form and inserting the data into two tables (customer info into one table, userid and password into another).
Currently, in my script I can insert data from the form in either table, but not in both tables. Here is what I have;
if ($isValid == 1) {
$query = "INSERT INTO mycustomer Values(null, '$fname', '$lname', '$address', '$address2', '$city', '$state', '$zip', '$email', '$phone')";
$query = "INSERT INTO authorized_users Values('$userid', '$pass1', null, '$secret', '$secretType')";
if(!mysqli_query($db, $query)){
echo mysqli_error($db);
}else{
echo "<font><b>Data added to the database</b></font><br>";
exit;
}
}
I do not get an error - which sucks . . Either $query will work - (adds data to database) but with both it always skips the first . . .
I have scoured my book - PHP and MySQL Web Development, but don't see any similar examples.
I have an excellent teacher - I am a week or two ahead of the class.
As always - help is appreciated.
Thanks,
Len