sandy1028 Posted November 16, 2007 Share Posted November 16, 2007 $result = mysql_query("select jobid from table1 $criteria and flag !='P'"); $no_of_rows = mysql_num_rows($result); while($r = mysql_fetch_array($result)){ $exec = ' '; $res = mysql_query("select exec from table2 where jobid='".$r[0]."'"); if($row = mysql_fetch_array($res)){ $exec = $row[0]; print "$exec"; } | tfg83/2 | | tfg83/1 | | tfg83/0 | | tfg83/3 | | tfg83/2 | | tfg83/1 | | tfg83/0 | | tfg83/3 | | tfg83/2 | | tfg83/1 | | tfg83/0 | | tfg83/3 | | tfg83/2 | | tfg83/1 | | tfg83/0 | +----------+ 496 rows in set (0.24 sec) The output of table2 is 496 rows but when displaying shows only one value. How to display all the values of 496 in the table. Link to comment https://forums.phpfreaks.com/topic/77583-mysql_fetch_array/ Share on other sites More sharing options...
~n[EO]n~ Posted November 16, 2007 Share Posted November 16, 2007 You need to keep that in while loop as you did in your first query. Link to comment https://forums.phpfreaks.com/topic/77583-mysql_fetch_array/#findComment-392701 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.