我檢查了我的phpMyAdmin
中的Sql語句,它返回多個結果,但是當我將它作爲php腳本運行時,它不返回任何東西。任何人都可以告訴我我犯了什麼錯誤嗎?mysqli_fetch_array沒有返回任何東西
<?php
require "conn.php";
/*$sqlQry = $_POST["sqlQry"];*/
$sqlQry = "SELECT bad.id, Name, Address, Latitude, Longitude, AvAge FROM baraddresses bad inner join barlivedata bld on bad.id = bld.id inner join bar_data bdt on bdt.id = bad.id";
$result = mysqli_query($conn ,$sqlQry);
$json = array();
while ($row = mysqli_fetch_array($result , MYSQL_NUM)){
$json[] = array('id' => $row[0],
'Name' => $row[1],
'Address' => $row[2],
'Latitude'=> $row[3],
'Longitude' => $row[4],
'AvAge' => $row[5]
);
}
$jsonstring = json_encode($json);
echo $jsonstring;
?>
Conn.php
變化MYSQLI_NUM –
這是否返回任何東西當U上的PHP myadmin運行? –
是的,它在phpmyadmin中。 – Gurchani