advancedfuture Posted December 25, 2009 Share Posted December 25, 2009 Happy Holidays Fellow PHPFreaks! I wanted to know how can I combine these two queries, if possible at all. $query = "UPDATE users SET active='n' WHERE username='$payer_email'"; mysql_query($query); $query = "DELETE FROM services WHERE username='$payer_email'"; mysql_query($query); Quote Link to comment https://forums.phpfreaks.com/topic/186355-how-can-i-combine-these-queries/ Share on other sites More sharing options...
trq Posted December 26, 2009 Share Posted December 26, 2009 mysql_query() can only handle one query at a time so executing these as separate queries is the best you can do I'm afraid. Quote Link to comment https://forums.phpfreaks.com/topic/186355-how-can-i-combine-these-queries/#findComment-984102 Share on other sites More sharing options...
PFMaBiSmAd Posted December 26, 2009 Share Posted December 26, 2009 And since you would want to check in your application code if the UPDATE query is successful before you execute the DELETE query, you would not necessarily want to ever combine them. Quote Link to comment https://forums.phpfreaks.com/topic/186355-how-can-i-combine-these-queries/#findComment-984111 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.