croix Posted May 24, 2007 Share Posted May 24, 2007 Hello, I am getting SQL syntax error on a page that I am in the process of converting from Access to MySQL. Here is the error: Invalid query: 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 '* FROM customers WHERE customerID = 727' at line 1 Whole query: DELETE * FROM customers WHERE customerID = 727 I checked out the MySQL manual, but I don't see anything wrong with my syntax.... maybe Im looking in the wrong place. ******EDIT****** I was looking at the wrong documentation... The proper (and working) syntax was DELETE FROM customers WHERE .... Quote Link to comment https://forums.phpfreaks.com/topic/52841-solved-invalid-query-sql-syntax-was-working-before-conversion/ Share on other sites More sharing options...
Wildbug Posted May 24, 2007 Share Posted May 24, 2007 Remove the asterisk. No columns are used in the DELETE command as the entire row is always deleted. DELETE FROM customers WHERE customerID = $customerID; Quote Link to comment https://forums.phpfreaks.com/topic/52841-solved-invalid-query-sql-syntax-was-working-before-conversion/#findComment-260850 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.