blueman378 Posted March 10, 2008 Share Posted March 10, 2008 hi guys i was wondering would a guery like this work: $query = "DELETE * FROM users,contacts,project WHERE id='$_SESSION[userid]' "; $result = mysql_query($query); thanks Link to comment https://forums.phpfreaks.com/topic/95352-delete-from-multiple-tables-at-once/ Share on other sites More sharing options...
haku Posted March 10, 2008 Share Posted March 10, 2008 http://www.haughin.com/2007/11/01/mysql-delete-across-multiple-tables-using-join/ Link to comment https://forums.phpfreaks.com/topic/95352-delete-from-multiple-tables-at-once/#findComment-488366 Share on other sites More sharing options...
blueman378 Posted March 10, 2008 Author Share Posted March 10, 2008 yeah... im not exactly the best with joins, can someone please give me a example of how to delete * from the three tables where id = 1 (id is a consistant column on all 3 tables) cheers Link to comment https://forums.phpfreaks.com/topic/95352-delete-from-multiple-tables-at-once/#findComment-488425 Share on other sites More sharing options...
Jabop Posted March 10, 2008 Share Posted March 10, 2008 $query = "DELETE * FROM users,contacts,project WHERE id='$_SESSION[userid]' "; $result = mysql_query($query); $query = "DELETE * FROM users WHERE ID='$_SESSION[userid]'"; $query = "DELETE * FROM contacts WHERE ID='$_SESSION[userid]'"; $query = "DELETE * FROM projects WHERE ID='$_SESSION[userid]'"; Link to comment https://forums.phpfreaks.com/topic/95352-delete-from-multiple-tables-at-once/#findComment-488463 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.