mysqli中的这个查询有问题吗?我从mysql转换它,当时工作得很好,但现在不行
mysqli_query($con,"SELECT * FROM signed_out_students WHERE date = '$date6' AND time_in = '' order by time_out DESC");
这就是它适合实际代码的方式。我知道数据库中有今天日期的条目,但它没有显示它们?丁:
else if (out == $display) {
date_default_timezone_set('NZ');
$date6 = date('d.m.Y');
$result4 = mysqli_query($con,"SELECT * FROM signed_out_students WHERE date = '$date6' AND time_in = '' order by time_out DESC");
echo '<table border="0">';
echo '<tr>';
echo '<td width="70px"><h2>Date</h2>';
echo '</td>';
echo '<td width="150px"><h2>Name</h2>';
echo '</td>';
echo '<td width="90px"><h2>Form Class</h2>';
echo '</td>';
echo '<td width="70px"><h2>Time Out</h2>';
echo '</td>';
echo '<td width="70px"><h2>Time In</h2>';
echo '</td>';
while($row4 = mysqli_fetch_array($result4))
{
echo '<tr>';
echo '<td><p>' . $row4['date'];
echo '</td>';
echo '<td><p>' . $row4['name'];
echo '</td>';
echo '<td><p>' . $row4['form_class'];
echo '</td>';
echo '<td><p>' . $row4['time_out'];
echo '</td>';
echo '<td><p>' . $row4['time_in'];
if ($row['time_in'] == "") { echo '-';}
echo '</td>';
}
echo '</table>';
}
多谢你们!