我有2张桌子。我想把它们放到一个html表中(每个表都在一个单独的列中)。我认为mysql_fetch_array对我来说不适用于2个条件。
echo "<table id='123'>";
echo "<tr>
<th>header</th>
</tr><td>";
$query1 = "SELECT * FROM table1";
$result1 = mysql_query($query1) or die(mysql_error());
$query2 = "SELECT * FROM table2";
$result2 = mysql_query($query2) or die(mysql_error());
while($row1 = mysql_fetch_array($result1) && $row2 = mysql_fetch_array($result2)){
echo "<tr><td>";
echo "";
echo "</td><td>";
echo $row1['score'];
echo "</td><td>";
echo $row2['score'];
echo "</td></tr>";
}
echo "</td></table> <br>";
我该如何解决这个问题?