Page 1 of 1

Not sure what this error is...

Posted: Fri Jun 29, 2007 11:50 am
by thefreebielife

Code: Select all

Could not insert data because 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 's)' at line 1
I don't know what it means by "s)"

Any suggestions?

Posted: Fri Jun 29, 2007 11:56 am
by idevlin
Show us your SQL statement and we might be able to help.

Posted: Fri Jun 29, 2007 11:58 am
by thefreebielife

Code: Select all

//if not insert data
if ($error == "none") { 
$insert = mysql_query("insert into users values ('$username', '$pass2', '$fname', '$phone', '$Email', '$address', '$city', '$state', '$zip', '$country', '$ip', '$date's)")
or die("Could not insert data because ".mysql_error());
echo '<center><font color="#ff0000"><h4>Thank You, Your Account Has Been Created</h4>'; 
if ($error == "none") {
echo '<meta http-equiv="refresh" content="3;url=login.php">';
   exit;
   }
}

Posted: Fri Jun 29, 2007 12:00 pm
by idevlin

Code: Select all

'$date's)") 
You can't have punctuation in a data field. Rename it to $dates.

Posted: Fri Jun 29, 2007 12:24 pm
by thefreebielife
thanks, stupid mistake.

Posted: Fri Jun 29, 2007 12:26 pm
by idevlin
thefreebielife wrote:thanks, stupid mistake.
No worries! Happens everyone!

Re: Not sure what this error is...

Posted: Fri Jun 29, 2007 12:32 pm
by superdezign
thefreebielife wrote:

Code: Select all

Could not insert data because 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 's)' at line 1
Hehe, never noticed how many keywords SQL has. :-P