0

对不起我的英语,我的日期栏是 1375801584 有价值的纪元格式。我只想选择现在和下次记录,我想隐藏历史记录。例如:19:45 及以后。

<?php
$sql = mysql_query("select tarih from table where tarih < '$date' order by tarih ASC");
while($r = mysql_fetch_assoc($sql)){
?>
    <tr><td><?php echo date("Y-m-d", $r['tarih']); ?></td>
    <td><?php echo date("H:i", $r['tarih']); ?></td></tr>
<?php
}
?>
4

1 回答 1

2

你差一点。您当前的查询正在选择较旧的记录 ( <)。尝试使用>=

$sql = mysql_query("select date from table where date >= '$date;' order by date ASC");
于 2013-08-06T21:11:05.783 回答