karimali831 Posted July 21, 2010 Share Posted July 21, 2010 Hi, Instead of using the below, how can I generate an array for $row['ID'] and use the array in my query? $query = mysql_query("SELECT ID FROM table WHERE 1on1='1'"); while($row=mysql_fetch_array($query)) { $query2 = mysql_query("SELECT type FROM table2 WHERE ID='".$row['ID']."'"); } Quote Link to comment https://forums.phpfreaks.com/topic/208480-array-in-query/ Share on other sites More sharing options...
trq Posted July 21, 2010 Share Posted July 21, 2010 You'll want to do neither, and look into using sql joins. Quote Link to comment https://forums.phpfreaks.com/topic/208480-array-in-query/#findComment-1089355 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.