Corbokhan Posted May 3, 2011 Share Posted May 3, 2011 Hey everyone, I'm having some trouble with a delete query that I can't quite figure out. When I delete one item using the query, "DELETE FROM APPS where appID='1' AND userID='1';" the query works fine and the row is deleted. When I delete one item at a time but use multiple queries the rows are not deleted. For example, I would call "DELETE FROM APPS where appID='1' AND userID='1';" and then "DELETE FROM APPS where appID='2' AND userID='1';" - Neither row is deleted. Finally when I delete multiple items using one query , "DELETE FROM APPS where appID='1' OR appID='2' AND userID='1';" - Neither row is deleted. Each of these queries work when I paste them directly into phpmyadmin, but not when using myslqi_query on a webpage. Any ideas why these queries aren't running successfully? [edit] Also, the queries that are not successfully running do not come back with an error message, they just do not perform the task. Quote Link to comment https://forums.phpfreaks.com/topic/235397-delete-query/ Share on other sites More sharing options...
fugix Posted May 3, 2011 Share Posted May 3, 2011 Do you have your code set to display mysql errors via mysql_error() ? Quote Link to comment https://forums.phpfreaks.com/topic/235397-delete-query/#findComment-1209739 Share on other sites More sharing options...
Corbokhan Posted May 3, 2011 Author Share Posted May 3, 2011 I actually just figured it out. I needed to add quotations. Been a long night! Thanks for the quick response though. Quote Link to comment https://forums.phpfreaks.com/topic/235397-delete-query/#findComment-1209740 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.