Giants,
Can you help me in the following, the next lines are given me the output of a query (the information here shown is only partial). The first part is doing fine. It loops through the Db and lists the output till there is nothing to display.
The next part is given me a headache. ;-(
What I want to achieve is the following; I want to use the output of query 1, but only the $row['id'] information. I want to feed this information into Query 2 and, when there is nothing in the database I want a table-row printed with no content, but when there is output of the Db I want to print this in a table-row.
Depending of the output it will be divided over several pages.
//start part 1
$result_webdb = mysql_query
("SELECT webdb.id, webdb.pay, webdb.firma, webdb.firma_adr FROM webdb WHERE id='$id' ORDER BY webdb.id limit $offset,$limit",$db);
while ($row = mysql_fetch_array($result_webdb))
{
printf("<tr bgcolor='#CCCCCC'><td width='80' font face='Arial,Helvetica'><font color='#000066'><font size=-1><b>Company:</b></td>
<td width='200' font face='Arial,Helvetica'><font size=-1><a TARGET='_new' HREF='%s?id=%s&firma=%s&firma_www=%s'></td>
", $PHP_SELF,
$row["id"], $row["firma_adr"], $row["firma_www"], $row["firma"], $row["pay"],
);
// end part 1
//start part 2
$result_opendb = mysql_query
("SELECT open.id, open.key_webdb, open.opendate, open.time_s, open.time_e FROM open WHERE key_webdb=$row['id'] AND opendate=$date limit $offset,$limit",$db);
while ($row = mysql_fetch_array($result_opendb))
{
Printf("<tr>
<td colspan ='2' font face='Arial,Helvetica'><font color='#000066'><font size=2 %s>Text</td><td></td>
<td align = center colspan = '2'>%s</td><td align = center colspan = '3'>%s - %s</td>
</tr>
</tr>
<td colspan ='7'> </td>
</tr>", $PHP_SELF,
$row["opendate"], $row["time_s"], $row["time_e"]);
}
}
// end part 2
Thanks for looking into it,
-John