所以我正在编写一小段代码,它获取查询结果并将其打印出来,但它也给了我这个:
警告:mysqli_result::fetch_assoc():无法在第 24 行的 /var/www/vhosts/apexfunrun.com/httpdocs/dev/timer.php 中获取 mysqli_result
$query = "SELECT field_pep_rally_date_value FROM dr_content_type_school WHERE nid = '$schoolname'";
if ($result = $mysqli->query($query)) {
while ($row = $result->fetch_assoc()) {
$date = $row['field_pep_rally_date_value'];
$date = str_replace('-', '/', $date);
echo date('Y-m-d', strtotime($date));
$result->close();
}
}
$mysqli->close();