目前我正在使用
select text, tid from notifications where user = '".$_SESSION['id']."' ORDER BY id asc
但如果我使用:
select text, tid from notifications where user = '".$_SESSION['id']."' ORDER BY id asc LIMIT 0,25
它只查看前 25 个。它必须是最新的 25 个。我该怎么做?
认为我解决了这个问题?
$total = mysql_query("select id from notifications where user = '".$_SESSION['id']."'");
$total = mysql_num_rows($total)-25;
$l = mysql_query("select text, tid from notifications where user = '".$_SESSION['id']."' ORDER BY id asc limit $total,25") or die ( mysql_error());