Hi guys,
I have a simple form, 2 fields, user and pass. With a submit. The following script should have taken these entries and inserted them into the database with this script. However I get a parse error on line 18. What have i done wrong? I've copied this straight out of my PHP tutorial book!
<?
if (!$user || !$pass)
{
echo "You have not filled out all the fields. Please hit back on your browser.<br>";
exit;
}
$user = addslashes($user)
$pass = addslashes($pass) <-- line 18
$db = mysql_connect("D", "admin", "****") or die ("Couldn't connect.");
mysql_select_db("iedge", $db) or die ("Couldn't select db.");
$query = "insert into players values
('".$user."', '".$pass."');
$result= mysql_query($query);
if ($result)
echo "Your account has been created.";
?>
The table 'players' has a 3rd column, the primary key, gameID. I want this to be auto assigned. So I did not put it on the form. Is this why? Will MySql automatically enter a value for this column once user and pass have been entered? It is set to 'not null' and 'auto increment'.
Thanks a lot for any help!
D