what's wrong with this SQL string?
-
This is the string that I have printed to the screen.
INSERT INTO signatures (name, order, email, salesperson, ip, browser, signed, referrer) VALUES('b','888888888','','guy','62.219.49.132','','1','')
The following is the code that executes the query
if (!mysql_query($sqlString, $con))
{
die('Error: ' . mysql_error());
$success = false;
}It gives me the following error Error: 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 'order, email, salesperson, ip, browser, signed, referrer) VALUES('b','888888888'' at line 1
-
This is the string that I have printed to the screen.
INSERT INTO signatures (name, order, email, salesperson, ip, browser, signed, referrer) VALUES('b','888888888','','guy','62.219.49.132','','1','')
The following is the code that executes the query
if (!mysql_query($sqlString, $con))
{
die('Error: ' . mysql_error());
$success = false;
}It gives me the following error Error: 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 'order, email, salesperson, ip, browser, signed, referrer) VALUES('b','888888888'' at line 1
one of them must be a reserved keyword, for which an escape exists, IIRC it is square brackets. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
This is the string that I have printed to the screen.
INSERT INTO signatures (name, order, email, salesperson, ip, browser, signed, referrer) VALUES('b','888888888','','guy','62.219.49.132','','1','')
The following is the code that executes the query
if (!mysql_query($sqlString, $con))
{
die('Error: ' . mysql_error());
$success = false;
}It gives me the following error Error: 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 'order, email, salesperson, ip, browser, signed, referrer) VALUES('b','888888888'' at line 1
INSERT INTO signatures (name, `order`, email, salesperson, ip, browser, signed, referrer) VALUES('b','888888888','','guy','62.219.49.132','','1','')
order====>`order`