您想帮助我修改代码吗?在SQL中联接表时遇到障碍。这是我的代码:
<?php
include_once ('config.php');
$query = "SELECT tb_m_price.price, tb_m_route.location_id, tb_m_location.pool_name_id,
tb_m_pool.pool_name
FROM tb_m_price
INNER JOIN tb_m_route ON tb_m_route.price_id = tb_m_price.price_id
INNER JOIN tb_m_location ON tb_m_location.location_id = tb_m_route.location_id
INNER JOIN tb_m_pool ON tb_m_pool.pool_id = tb_m_location.pool_id
LEFT JOIN (
SELECT class_id
FROM tb_m_bus
ON tb_m_class.class_id = tb_m_bus.class_id GROUP BY tb_m_class.class_name
)";
$result = mysqli_query ($con, $query);
$array_data = array();
while($baris = mysqli_fetch_assoc($result)){
$array_data [] = $baris;
}
echo json_encode `enter code here`($array_data);
?>
我在行中出错:
while($baris = mysqli_fetch_assoc($result)){
$array_data [] = $baris;
}
提前谢谢