编码:
$query = "SELECT * FROM tweets WHERE read=n";
$result = mysqli_query($mysqli,$query);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
echo $row["from_user"], $row["text"];
上面的代码给了我这个:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /index.php on line 16
下面的代码没有:
$query = "SELECT * FROM tweets";
$result = mysqli_query($mysqli,$query);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
echo $row["from_user"], $row["text"];
“读取”字段是 ENUM('y','n')。