gigantorTRON Posted September 5, 2007 Share Posted September 5, 2007 I have two tables that need to be queried as part of a php script. table1 signId tableId clientId table2 tableId latitude longitude query: SELECT latitude FROM table2 WHERE tableId IN (SELECT tableId FROM table1 WHERE signId = $_GET['id']); Thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/68131-solved-easier-way-to-do-this-query/ Share on other sites More sharing options...
cmgmyr Posted September 6, 2007 Share Posted September 6, 2007 try... SELECT t2.latitude FROM table2 t2 INNER JOIN table1 t1 ON (t1.tableId = t2.tableId) WHERE t1.signId = $_GET['id']; Quote Link to comment https://forums.phpfreaks.com/topic/68131-solved-easier-way-to-do-this-query/#findComment-342542 Share on other sites More sharing options...
gigantorTRON Posted September 6, 2007 Author Share Posted September 6, 2007 You Rock! Quote Link to comment https://forums.phpfreaks.com/topic/68131-solved-easier-way-to-do-this-query/#findComment-342611 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.