Hi. I recently created a PHP Comment snippet. I'm having one slight probleme though.

The problem is that the comments stacks up to one big pile of comments.

What I basically want is to divide the amount into smaller groups:


Page: 1, 2, 3, 4, 5 each page with 5 comments Newer -> Older -> Oldest.

Can anyone give me an idea how I would do that with php and mySQL?

Member Avatar for diafol

This is called pagination. It's been covered to death in this forum. Search.

This is called pagination. It's been covered to death in this forum. Search.

Ok, thanks. One question though.

How can I add "ORDER BY time DESC "

to

"SELECT * FROM $tableName LIMIT $start, $limit"?

Member Avatar for diafol

ORDER BY goes before LIMIT

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.