Need last 10 posts code for lavalair

Started on the old forum in August 2009 · view the original in the archive · old links redirect here

5 replies · 477 views · started 17 years ago · 1 min read

4 participants
arman Newbie · 8 posts #1

hi,anybody can help me by giving this code?thanks

Coding Life :)

arman Newbie · 8 posts #4

no,this is for last 10 posts.

$sql = "SELECT a.name, b.uid, b.tid FROM ibwf_topics a INNER JOIN ibwf_posts b ON a.id = b.tid ORDER BY b.id DESC LIMIT 0 , 10"; echo " "; $items = mysql_query($sql); echo mysql_error(); while ($item = mysql_fetch_array($items)) { $a = htmlspecialchars($item[0]); $b = getnick_uid($item[1]); $c = "<ahref="index.php?action=viewtpc&sid=$sid&tid=$item[2]&go=last">$a</a>"; $d = "<ahref="index.php?action=viewuser&sid=$sid&who=$item[1]">$b</a>"; echo "$c By: $d ";}.i try it.it work in index page.

Coding Life :)

kiLLeR-eyEd_14 Senior · 382 posts #6

arman wrote: no,this is for last 10 posts.i have this code but n't working.

$sql = "SELECT a.name, b.uid, b.tid FROM ibwf_topics a INNER JOIN ibwf_posts b ON a.id = b.tid ORDER BY b.id DESC LIMIT 0 , 10"; echo " "; $items = mysql_query($sql); echo mysql_error(); while ($item = mysql_fetch_array($items)) { $a = htmlspecialchars($item[0]); $b = getnick_uid($item[1]); $c = "<ahref="index.php?action=viewtpc&sid=$sid&tid=$item[2]&go=last">$a</a>"; $d = "<ahref="index.php?action=viewuser&sid=$sid&who=$item[1]">$b</a>"; echo "$c By: $d "; }

is anything need to add in table?i try it.it work in index page but show all 10 posts in index.

the post is already in the topic..so you'll still view the topic..it's also the same as latest forum topics..And in ur script posted, why order by id?it should be order by lastpost..

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close