ok, what ive done is made an html form, you type in info etc and click submit and it sneds it to register.php, which puts it into a database, but what i want it to do is to also add some more info into another table in the database, but it doesnt seem to do it, heres what i have, $add works fine, but it doesnt add $add2 to the database:
<?php
$conn = mysql_connect('localhost', 'tisza', '');
mysql_select_db('game',$conn);
$add = "INSERT INTO info values ('', '$_POST[name]', '$_POST[pass]', '$_POST[email]', '$_POST[race]', '1', '0', '100', '25', '25', '10', '10', '100', '100', '1', '1', '1', '1', '1', '1', '1', '50', '0')";
$add2 = "INSERT INTO inv values ('', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', '0' 'None', '0', 'None', '0', 'None', '0', 'None', '0')";
$checkname = "SELECT name FROM info WHERE name='$_POST[name]'";
$checkemail = "SELECT email FROM info WHERE email='$_POST[email]'";
$namecheck = mysql_query($checkname);
$emailcheck = mysql_query($checkemail);
if ( mysql_num_rows($namecheck) >= 1 ) {
echo "The name already exists. <a href='register.html'>Back</a>";
} elseif ( mysql_num_rows($emailcheck) >= 1 ) {
echo "That email adress has already been used. <a href='register.html'>Back</a>";
} else {
mysql_query($add,$conn);
mysql_query($add2,$conn);
echo "You have signed up sucessfully! Click <a href='index.php'>here</a> to login.";
}
?>
also is there a better way to add those 2 things like for it to give an error message if they dont get put in the database, because right now it will says "you have signed up sucessfully" whether or not the two querys work, thx