Could anyone direct me towards a good guide or book which can explain to me how tables in mysql databases work and are to be set up. I am trying to set up a site where i need input into several tables on the same database at once, which does not work for me. I've skimmed about a little and saw I should refrence the tables to one main table via an index key or something of the like or other. I need to find a place where I can just review how I can link several tables together.
OR
If you could help me figure out why something like this:
Code: Select all
$newuser = mysql_query("INSERT INTO members (username, password, userlevel, email) VALUES ('$username', '$password', '$userlevel', '$email')");
$newinfo = mysql_query("INSERT INTO members_info SET username='$username', userlevel='$userlevel', email='$email', join date='$joindate' ");
does not work. The second table has a bunch of more variables such as first name, last name, dob, location, profile pic, registration code, join date. when i omit a field for the first one it works fine, the second one won't work at all. I used 'SET' in the second one because i thought maybe it would not require all fields.