wincen Posted February 26, 2008 Share Posted February 26, 2008 Is it possible to execute a prepared statement that does multiple queries? For example, say I need to delete a user from my database. I would need to delete all his child records. In a stored procedure typically I would delete all the child records, like messages from the user, then i would delete the actual user record. With a prepared statement can I do the same, if so how? Otherwise would I need to run multiple prepared statements to do the same? Link to comment https://forums.phpfreaks.com/topic/93211-prepared-statements-multiple-queries/ Share on other sites More sharing options...
aschk Posted February 27, 2008 Share Posted February 27, 2008 You'd need more than 1 prepared statement, as I imagine your SP would usually have more than one delete query Consider using FK constraints with cascading. Link to comment https://forums.phpfreaks.com/topic/93211-prepared-statements-multiple-queries/#findComment-477962 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.