它始终将输出设为bool(false)
。我有数据库的表列名LocationLong
和LocationLat
。
$ulat = $data['ULat'];
$ulong = $data['ULong'];
$sql = "SELECT PostId, (3959 * acos(cos(radians($ulat)) * cos(radians(LocationLat))
* cos(radians(LocationLong) - radians($ulong)) + sin(radians($ulat))
* sin(radians(lLocationLatat)))) AS distance
FROM VehicleDetails HAVING distance < 250 ORDER BY distance LIMIT 0, 20";
$query = mysqli_query($con, $sql);
var_dump($query);
答案 0 :(得分:0)
您没有考虑您的查询可能失败。从:
开始$query = mysqli_query($con, $sql) or die('query fails');
var_dump($query);
答案 1 :(得分:0)
N/currentRecord
您将获得发生的任何错误的描述,以便您可以在不猜测的情况下修复它。