rahman rahman - 1 year ago 95
PHP Question

Error in SQL syntax of PHP report from MySQL database


SELECT * FROM stock_sales where transactionid=\"SD254\"

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 '\"SD254\"' at line 1

Answer Source

Unless your database is set up to handle double quotes, the normal way to write this query in MySQL would be

SELECT * FROM stock_sales where transactionid='SD254'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download