我想打印每個帖子一個incresing號碼。像每個論壇都有這個。分頁和行編號
我目前使用的:
$i = 0; while ($post = mysql_fetch_assoc($rs)): $i++;
可以說我每頁打印5後
這是發生了什麼:
#1 First post
#2 2nd post
#3 3rd post
#4 4th post
#5 5th post
Then you go to page to 2
#1 6th post
#2 7th post
#3 8th post
#4 9th post
#5 10th post
我不希望這樣,我希望它保持從第一頁開始增加最高數字
sql:
SELECT u.group_id, u.username, u.title, p.poster, p.message, p.thread_id, g.g_title, g.g_user_title FROM posts AS p
INNER JOIN users AS u ON u.id = p.poster
INNER JOIN groups AS g ON g.g_id = u.group_id
WHERE p.thread_id = $id
LIMIT $startIndex, $perPage
計數它不會與頁面#1的工作是 – Kirzilla 2010-07-28 15:27:13
它會如果你從0開始計數 – tster 2010-07-28 17:18:13