我有以下代码
// Connect to server and select database.
$conn = new mysqli($host, $username, $password, 'gs') ;
if($conn->connect_errno){
printf("Connect failed: %s\n", $conn->connect_error);
exit();
}
$result = $conn->query("SELECT gs_users.id, gs_user_objects.imei, gs_objects.lat, gs_objects.lng,
gs_objects.dt_server, gs_objects.name, gs_objects.odometer,
tablet_dispatch.destination, tablet_dispatch.reg, tablet_dispatch.d_name
FROM gs_users
INNER JOIN gs_user_objects ON gs_users.id = gs_user_objects.user_id
INNER JOIN gs_objects ON gs_user_objects.imei = gs_objects.imei
INNER JOIN tablet_dispatch ON gs_objects.name = tablet_dispatch.reg
WHERE tablet_dispatch.client_id = '299'
")
or trigger_error($conn->error);
$rows = $result->fetch_array(MYSQL_BOTH);
?>
<tr>
<td><a href="#!"><? echo $rows['reg']; ?></a></td>
<td><? echo $rows['d_name']; ?></td>
<td><? echo $rows['destination']; ?></td>
<td><? echo $rows['lat']; ?>, <? echo $rows['lng']; ?></td>
<td><? echo $rows['dt_server']; ?></td>
</tr>
它正在从数据库中提取信息,但仅显示第一行。我需要根据查询显示所有行