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']."'"); } 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. Link to comment https://forums.phpfreaks.com/topic/208480-array-in-query/#findComment-1089355 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.