rahman rahman - 2 months ago 28
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


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'