Kryptix Posted February 14, 2010 Share Posted February 14, 2010 UPDATE `rscd_quests` SET (`quest_stage`, `finished`) VALUES ('0', '0') WHERE `user` = '0' AND `quest_id` = '0' Is it possible to insert into another table too within the same query? Say for example I wanted to do the exact same but into `rscd_quests2` as well. Quote Link to comment Share on other sites More sharing options...
kickstart Posted February 14, 2010 Share Posted February 14, 2010 Hi You can update to multiple table (doing a join) but don't think you can do an insert. If they need to happen at the same time you need to wrap them in a transaction. All the best Keith Quote Link to comment Share on other sites More sharing options...
Kryptix Posted February 14, 2010 Author Share Posted February 14, 2010 Hm, OK. Could you show me how to do an UPDATE JOIN please? Quote Link to comment Share on other sites More sharing options...
kickstart Posted February 14, 2010 Share Posted February 14, 2010 Hi Something like this UPDATE `rscd_quests`a INNER JOIN `rscd_quests2` b ON a.`user` = b.`user` AND a.quest_id = b.quest_id SET quest_stage = '0', `finished` = '0' WHERE a.`user` = '0' AND a.`quest_id` = '0' All the best Keith Quote Link to comment 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.