renevanh
06-12-2008, 02:38 PM
I have a database with some data in it.
Now I need to delete a certain row from the database, which I'm trying to do with the following query:
DELETE FROM tbl_cart, tbl_users WHERE tbl_users.username = 'renevanh' AND tbl_cart.KlantID = tbl_users.id AND tbl_cart.product= 'test' LIMIT 1
When I excute this query (MySQL database using PHPmyAdmin), I get an error:
#1064 - 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 'WHERE tbl_users.username = 'renevanh' AND tbl_cart.KlantID = tbl_users.id AND tb' at line 1
I tried a lot of things, but I can't find the problem.
When I try the same WHERE clause with a SELECT query, it works just fine.
Does anyone see the problem here?
Now I need to delete a certain row from the database, which I'm trying to do with the following query:
DELETE FROM tbl_cart, tbl_users WHERE tbl_users.username = 'renevanh' AND tbl_cart.KlantID = tbl_users.id AND tbl_cart.product= 'test' LIMIT 1
When I excute this query (MySQL database using PHPmyAdmin), I get an error:
#1064 - 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 'WHERE tbl_users.username = 'renevanh' AND tbl_cart.KlantID = tbl_users.id AND tb' at line 1
I tried a lot of things, but I can't find the problem.
When I try the same WHERE clause with a SELECT query, it works just fine.
Does anyone see the problem here?