【发布时间】:2013-11-27 16:18:28
【问题描述】:
我有一个 fetch_assoc 查询,它将抓取 14 行,但我希望显示第一个结果,以便它与其他结果不同,然后其余的只是普通的。
$site_events = $db->query("SELECT * FROM site_events ORDER BY time ASC limit 14");
while($events = $site_events->fetch_assoc()) {
if( first result???? ) { //this is where im stuck
echo $events['title'], 'FIRST RESULT';
}
//then display others like a normal list..
echo $events['title'], '<br />';
}
【问题讨论】:
-
你总是可以使用一个变量来存储状态