我正在使用mysql数据库。当我登录phpmyadmin并运行此查询
SELECT * FROM TABLE1 WHERE Lat BETWEEN 56.000 AND 57.454 AND Lng BETWEEN 80.3434 AND 83.345
我按预期得到了一些结果。但是,当我使用Php运行相同的Query时,我得到0结果。
$sql = "SELECT * FROM TABLE1 WHERE Lat BETWEEN '$minlat' AND '$mazlat' AND Lng BETWEEN '$minlng' AND '$maxlng' ";
为什么Php代码返回0结果?
答案 0 :(得分:-1)
编写没有单克隆的代码。像这样。
$sql = "SELECT * FROM TABLE1 WHERE Lat BETWEEN $minlat and $mazlat AND Lng BETWEEN $minlng and $maxlng";