Alex_TCD Alex_TCD - 3 months ago 13
PHP Question

SQL Server incorrect syntax near the keyword 'order'

The Error code is: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near the keyword 'order'. ) )

$tsql = "INSERT INTO dbo.order(client,
contact,
vendor,
iteminfo,
ourcost,
ourshipping,
pricequote,
shipquote,
shipinfo,
requestor)
VALUES (?,?,?,?,?,?,?,?,?,?)";

$params = array(&$_POST['client'],
&$_POST['contact'],
&$_POST['vendor'],
&$_POST['iteminfo'],
&$_POST['ourcost'],
&$_POST['ourshipping'],
&$_POST['pricequote'],
&$_POST['shipquote'],
&$_POST['shipinfo'],
&$_POST['requestor']);


This is just about identical to another table I've got and it works just fine. What am I missing here?

Answer

order is a reserved word put it in []'s INSERT INTO dbo.[order](client, or change the name of the table to not use keywords