atomicrabbit Posted September 14, 2008 Share Posted September 14, 2008 ok i'm trying to delete multiple entries from multiple tables. In this specific case, I want to delete all specified entries from mw_users and mw_companies (which most likely will exist), but delete the entries from mw_orders ONLY if they exist. Using OR instead of AND deletes ALL values from ALL three tables. DELETE mw_users, mw_companies, mw_orders FROM mw_users, mw_companies, mw_orders WHERE mw_users.company_id IN ('27','28') AND mw_companies.id IN ('27','28') AND mw_orders.company_id IN ('27','28') Link to comment https://forums.phpfreaks.com/topic/124208-solved-delete-from-multiple-tables/ Share on other sites More sharing options...
Mchl Posted September 14, 2008 Share Posted September 14, 2008 I'm of opinion that deleting from multiple tables should be performed by multiple queries Link to comment https://forums.phpfreaks.com/topic/124208-solved-delete-from-multiple-tables/#findComment-641300 Share on other sites More sharing options...
atomicrabbit Posted September 14, 2008 Author Share Posted September 14, 2008 but is what I want to do possible? Link to comment https://forums.phpfreaks.com/topic/124208-solved-delete-from-multiple-tables/#findComment-641327 Share on other sites More sharing options...
fenway Posted September 15, 2008 Share Posted September 15, 2008 but is what I want to do possible? Yes, it should have worked. Link to comment https://forums.phpfreaks.com/topic/124208-solved-delete-from-multiple-tables/#findComment-641967 Share on other sites More sharing options...
atomicrabbit Posted September 16, 2008 Author Share Posted September 16, 2008 dunno why it didn't. I decided to just use separate queries Link to comment https://forums.phpfreaks.com/topic/124208-solved-delete-from-multiple-tables/#findComment-642799 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.