Page 1 of 1

MYSQL INSERT

Posted: Fri Jun 03, 2005 8:46 am
by Parody
Anything wrong with this:

Code: Select all

mysql_connect("localhost", "admin", "ak7456") or die(mysql_error());
mysql_select_db("users") or die(mysql_error());
$regdate = date('m d, Y');
mysql_query("INSERT INTO users('".$_POST['uname']."', '$rand', '".$_POST['email'].")";
mysql_query("INSERT INTO stats('".$_POST['uname']."','$character', '100', '2000', '001', '01', 000, '01', '01', '01', '1', '0', '00000000', '00000000', '00000000', '00000000')");
I get this error for some reason:

Code: Select all

Parse error: parse error in c:\program files\eas1yphp1-8\www\registertmp.php on line 75
Line 75 is the first mysql_query , this one:

Code: Select all

mysql_query("INSERT INTO users('".$_POST['uname']."', '$rand', '".$_POST['email'].")";
ALL HELP APPRECIATTED :D

Re: MYSQL INSERT

Posted: Fri Jun 03, 2005 8:55 am
by Buddha443556
Parody wrote:Line 75 is the first mysql_query , this one:

Code: Select all

mysql_query("INSERT INTO users('".$_POST['uname']."', '$rand', '".$_POST['email'].")";
Your missing a single quote for $_POST['email'] value.

Code: Select all

mysql_query("INSERT INTO users('".$_POST['uname']."', '$rand', '".$_POST['email']."')";
I have no idea why the parse error, check for other quote problems above line 75.

Posted: Fri Jun 03, 2005 9:24 am
by artexercise

Code: Select all

mysql_query(&quote;INSERT INTO users('&quote;.$_POSTї'uname'].&quote;', '$rand', '&quote;.$_POSTї'email'].&quote;')&quote;);
missing the close parantheses on the mysql_query also. Added it above.

JOE--