Jump to content

PHP & MySQL WHERE order listing help.


Salis

Recommended Posts

I know that there are a few free Forums and BB out there but they do have their limitations, even with mods. I am working on a site that has a forum but it is a special forum.

I know PHP and MySQL. I can create every thing that I need, the control panels, register pages post pages and what not, I can even make a topic viewer but that is the problem. Basically If I make a post then some one else and after some one else another guy, but when the posts are read from the database they are not listed as they need to be. It's like this:

[i]This is how it should be[/i]

Salis: Yo, So are we ready?
The_Kid: No, not 'till tomorrow
robins-j: What's the hold up

Ok, but this is what it would look like when read from the database

The_Kid: No, not 'till tomorrow
Salis: Yo, So are we ready?
robins-j: What's the hold up

This is the code I'm using to pull the info from the DB

[code]
$query = mysql_query("SELECT * FROM posts WHERE page_id = '$id'");

while ($row = mysql_fetch_array($query))
{
  include('view_post.php');
}
[/code]

I'm guessing it's something simple but I'm not sure. Can any one help me out?

*EDIT*
I forgot to mention that I do have a posting count set as a primary and an auto incerment
Link to comment
https://forums.phpfreaks.com/topic/16548-php-mysql-where-order-listing-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.