Need help with shoutbox

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply

Thu Oct 17, 2002 12:39 pm

Hey everyone, my names Nick, or vahn or whatever you'd like.

Im currently writing a some what simple script for my freind's website.
Its called a shoutbox, and for those of you who havnt heard of them, they are like small message boards. They are for short comments that are posted on the main page of a website.

For a working example of a shout box, check out the shoutbox is called 'youth yak' on the right side at the bottom.

My problem is, I want to limit the number of posts to be shown at a time. Instead of having a page full of 60 shouts. I cant figure out how to make the script check to see if there are more than the set amount of shouts. And if their are , to delelte the neccessary amount of old shouts.

Another problem is, i am using RSORT(reverse sort) function, to arrange the shouts from top to bottom. It was working fine, until recently, now it arrangers them in alphabetical order, then reverses the list. Any help?

Here is a link to a .txt file so you can view the source code. (sorry if its sloppy, i need to get in the habbit of adding comments).

And here is a link to the beta version of the working source code I am working on.

Please let me know what you think, and any comments you might have, thanks!


Thu Oct 17, 2002 12:49 pm

Your script wouldn't load for me, but if you are using a MySQL database you can use the limit syntax at the end of your script.
$query = "select * from table limit 5,20
5 = starting row
20 = rows to return

New php-forum User
New php-forum User
Posts: 18
Joined: Fri Sep 27, 2002 6:35 am

Fri Oct 18, 2002 10:42 am

try to use foreach() instead of for(). it might help
With best regards,
Cyril Kobets

Post Reply