PHP mssql_query double quotes cannot be used
Posted
by Nilesh
on Stack Overflow
See other posts from Stack Overflow
or by Nilesh
Published on 2010-04-06T22:12:47Z
Indexed on
2010/04/06
22:23 UTC
Read the original article
Hit count: 462
Hi all, In java-jdbc, I can easily run the following SQL (NOTE the double quotes around columns and table names)
Select
cus."customer_id" ,
cus."organisation_or_person" ,
cus."organisation_name" ,
cus."first_name" ,
cus."last_name" ,
cus."date_became_customer" ,
cus."other_customer_details"
From
"Contact_Management"."dbo"."Customers" cus
But the same query in PHP errors out saying invalid syntax
"Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near 'customer_id'. (severity 15) "
But If remove all the double quotes, the query works fine and no errors.
The query is ported from a java application so I would like to keep the double quotes and the SQL as it is. Any alternative solutions?
Thank you Nilesh
© Stack Overflow or respective owner