是否可以使用PHP将2个查询的结果输出到HTML表中?
<?php
if (isset($module_id) === true) {
$result = mysqli_query($link, "SELECT * FROM `assignments` WHERE `module_id` = '$module_id'") or die(mysqli_error($link));
if(mysqli_num_rows($result) === 0){
echo '<p>Sorry there was no results for that specific module.</p>';
}
$result1 = mysqli_query($link, "SELECT u.first_name FROM users u
LEFT JOIN usermodule um ON um.user_id = u.user_id
WHERE um.module_id = '$module_id'");
while($row = mysqli_fetch_row($result) && $row1 = mysqli_fetch_row($result1)){
echo
'<tr>',
'<td>'. $row[1] .'</td>',
'<td>'. $row[3] .'</td>',
'<td>'. $row1[0] .'</td>',
'<td>',
'<a href="././request.php"><button class="button-link">Request</button></a>',
'</td>',
'</tr>';
}
}
?>
它正在输出我的row1 [0]变量,但它忽略了我的第一个查询的行[1]和行[3] - 任何想法?