kernelgpf Posted October 17, 2007 Share Posted October 17, 2007 Is there a way to update several tables in the same query? My query is- mysql_query("update dragons set age=age+0.14,bondedwithtoday='0',dailyflight='no' where dead='no'"); And I want it to update the following tables: dragons,pegasus,fairies,unicorns,hippogriff but they all have the same columns.. Thanks! -Alyssa Quote Link to comment https://forums.phpfreaks.com/topic/73696-solved-update-several-tables-in-one-query/ Share on other sites More sharing options...
darkfreaks Posted October 17, 2007 Share Posted October 17, 2007 nvm Quote Link to comment https://forums.phpfreaks.com/topic/73696-solved-update-several-tables-in-one-query/#findComment-371834 Share on other sites More sharing options...
kernelgpf Posted October 17, 2007 Author Share Posted October 17, 2007 Oh okay. =P Quote Link to comment https://forums.phpfreaks.com/topic/73696-solved-update-several-tables-in-one-query/#findComment-371842 Share on other sites More sharing options...
marcus Posted October 17, 2007 Share Posted October 17, 2007 You're going to need to use an INNER JOIN. Quote Link to comment https://forums.phpfreaks.com/topic/73696-solved-update-several-tables-in-one-query/#findComment-371849 Share on other sites More sharing options...
kernelgpf Posted October 17, 2007 Author Share Posted October 17, 2007 I can figure it out from there. Thanks mgallforever. =] Quote Link to comment https://forums.phpfreaks.com/topic/73696-solved-update-several-tables-in-one-query/#findComment-371851 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.