嗨,我有一个查询可以产生我需要的内容,但是我在输出中得到重复的行并且无法弄清楚为什么每行出现两次。有任何想法吗?
$query = "SELECT * FROM orders LEFT JOIN users ON orders.USER_ID = users.USER_ID
LEFT JOIN items ON items.CHECKOUT_ID = orders.CHECKOUT_ID ORDER BY
date_order DESC LIMIT 0,1000";
$result = mysqli_query($con, $query);
while($row = mysqli_fetch_array($result, MYSQL_ASSOC)){
$order_id = $row["ORDER_ID"];
$date_order = $row["date_order"];
$date_req = $row["delivery"];
$country = $row["country"];
$firstname = $row["name"];
$lastname = $row["surname"];
$email = $row["email"];
$size = $row["size"];
$total_cost = $row["total_cost"];
echo '<tr><td>' . $order_id . ' </td>' .
'<td>' . $date_order . '</td>' .
'<td>' . $date_req . '</td>' .
'<td>' . $country . ' </td>' .
'<td>' . $firstname . ' </td>' .
'<td>' . $lastname . ' </td>' .
'<td>' . $email . ' </td>' .
'<td>' . $size . ' </td>' .
'<td>€' . number_format($total_cost, 2, '.', '') . ' </td>' .
'<td style="text-align:right"><a href="xxxxxxx_Order_Details_Admin.php?id=' . $order_id . '">More Details</td>' .
'<td style="text-align:right"><a href="xxxxxxxx_Order_Details_print.php?id=' . $order_id . '">Print</td>' .
'</tr>';