我的代码是
<?php
include 'includes/config.php';
$fetch = "SELECT *
FROM `status_comments`
WHERE status_id =4
AND item_poster = 'LUcase'";
echo $fetch;
$runfetch = mysqli_query($link, $fetch) or die(mysqli_error($link));
while ($comments = mysqli_fetch_assoc($runfetch)){ echo "woot"; }
?>
我正在回显$fetch,正如您所看到的,我在phpmyadmin中使用whats-echnold进行查询,它返回1行。但是在php中,它返回0行。问题出在哪里?
如果存在sql错误,请尝试使用mysqli_error()来指示。你能附上你的includephp文件吗?