Jump to content

mysql_fetch_array


sandy1028

Recommended Posts

$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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.