while statment with 2 different db query's
Posted: Sun Jan 18, 2004 12:02 pm
I can only generate the $datarow['c'] and not the $row['Files']; Isn't there a way to do 2 while conditions at the same time? I need the result to be formatted in 2 separate columns. Thanks!
Code: Select all
<?
include "dbconnect.php";
$query = "SELECT * FROM Briansutton_Files";
$result = mysql_query($query) or die(mysql_error());
$dataquery = "SELECT *, COUNT(*) AS c FROM Briansutton_Log GROUP BY Page";
$dataresult = mysql_query($dataquery) or die(mysql_error());
echo "<table border=1>";
while($row = mysql_fetch_assoc($result) && $datarow = mysql_fetch_assoc($dataresult))
{
echo "<td nowrap><font size=1 face=arial>".$row['Files']."</td>";
echo "<td nowrap><font size=1 face=arial>".$datarow['c']."</td></tr>";
}
echo "</table>";
?>