Doubt in INSERT statement (using autoincrement with mysql_r
Posted: Wed Nov 12, 2008 7:43 am
I want to know how to use autoincrement data with mysql_real_escape_string.
I have created a signup page. Every thing workred fine before adding a field with primary key and auto_increment called autoid[/b].
The current statement looks like this
$query2 = sprintf("INSERT INTO members
(autoid,username,password,confirm_pass,email,confirm_email,security_q,answer,)
VALUES (NULL,'%s','%s','%s','%s','%s','%s')",
mysql_real_escape_string($username,$connection),
mysql_real_escape_string($hash,$connection),
mysql_real_escape_string($hash1,$connection),
mysql_real_escape_string($email,$connection),
mysql_real_escape_string($confirm_email,$connection),
mysql_real_escape_string($security_q,$connection),
mysql_real_escape_string($answer,$connection));
Error it show is
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES (NULL<'suvin_prathab','a6b079d410b330cf262d2610522f8dd2bf25df1a',' at line 2
I have created a signup page. Every thing workred fine before adding a field with primary key and auto_increment called autoid[/b].
The current statement looks like this
$query2 = sprintf("INSERT INTO members
(autoid,username,password,confirm_pass,email,confirm_email,security_q,answer,)
VALUES (NULL,'%s','%s','%s','%s','%s','%s')",
mysql_real_escape_string($username,$connection),
mysql_real_escape_string($hash,$connection),
mysql_real_escape_string($hash1,$connection),
mysql_real_escape_string($email,$connection),
mysql_real_escape_string($confirm_email,$connection),
mysql_real_escape_string($security_q,$connection),
mysql_real_escape_string($answer,$connection));
Error it show is
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES (NULL<'suvin_prathab','a6b079d410b330cf262d2610522f8dd2bf25df1a',' at line 2