如何選擇前5個結果,然後添加更多選項?如何只選擇前5個結果,然後顯示更多..選項?
下面是當前的代碼:
<?php
$query="SELECT * FROM messages where u_id = '$uid' ORDER BY id DESC";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "";
$i=0;
while ($i < $num) {
$otheris=mysql_result($result,$i,"sender_full_name");
$sysid=mysql_result($result,$i,"sender_id");
$dob=mysql_result($result,$i,"dob");
// If $dob is empty
if (empty($dob)) {
$dob = "No new messages -
<a id=missingdob href=/test.php?id=$uid>
<bold>check later</bold></a>";
}
echo "<br><div id=linkcontain>
<a id=otherlink href=$mem/profile.php?id=$uid>
$manitis</a>
<br><div id=dobpres>$dob</div></div>";
echo "";
$i++;
}
?>
我假設你知道'LIMIT' ...對嗎?或者......那是你想知道的嗎? – 2011-03-16 22:22:54
不確定關於限制.. – AAA 2011-03-16 22:24:22