xxreenaxx1 Posted March 29, 2011 Share Posted March 29, 2011 How can you make these two delete function as one. DELETE FROM test WHERE Tes_ID= 11; DELETE FROM question WHERE Tes_ID=11; Quote Link to comment https://forums.phpfreaks.com/topic/232043-two-delete-function/ Share on other sites More sharing options...
techdude Posted March 29, 2011 Share Posted March 29, 2011 DELETE FROM test, question WHERE Tes_ID= 11; Post back if this helped. (Also, read the guidelines before posting.) -- techdude Quote Link to comment https://forums.phpfreaks.com/topic/232043-two-delete-function/#findComment-1193743 Share on other sites More sharing options...
xxreenaxx1 Posted March 29, 2011 Author Share Posted March 29, 2011 Nope. I tired few other ways as well. Nothing works. This is the error message I am getting Cannot Execute: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 Tes_ID=11' at line 3 I am using function for this method. And on line 3 I have function comple($Test_ID){ Quote Link to comment https://forums.phpfreaks.com/topic/232043-two-delete-function/#findComment-1193867 Share on other sites More sharing options...
techdude Posted March 29, 2011 Share Posted March 29, 2011 Ooops! Sorry, I got the syntax incorrect. Try this instead: DELETE t, q FROM test t, question q WHERE t.Tes_ID = q.Tes_ID AND t.Tes_ID = 27; Post back if this helped. -- techdude Quote Link to comment https://forums.phpfreaks.com/topic/232043-two-delete-function/#findComment-1193895 Share on other sites More sharing options...
xxreenaxx1 Posted March 30, 2011 Author Share Posted March 30, 2011 It worked. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/232043-two-delete-function/#findComment-1194180 Share on other sites More sharing options...
techdude Posted March 30, 2011 Share Posted March 30, 2011 Glad I can help -- techdude Quote Link to comment https://forums.phpfreaks.com/topic/232043-two-delete-function/#findComment-1194389 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.