我想确保在运行 while 循环之前有结果,但我尝试的所有方法似乎都删除了第一个结果。
$nearbyResult = mysqli_query($con,$sqlNearby);
if(mysqli_fetch_array($nearbyResult) == 0) {
echo '<p>No results found, <a href="/add.php">Add your property here</a>.</p>';
} else {
while($rowNearby = mysqli_fetch_array($nearbyResult)) {
}
}