Salis Posted August 4, 2006 Share Posted August 4, 2006 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 tomorrowrobins-j: What's the hold upOk, but this is what it would look like when read from the databaseThe_Kid: No, not 'till tomorrowSalis: Yo, So are we ready?robins-j: What's the hold upThis 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 Quote Link to comment Share on other sites More sharing options...
CTM Posted August 4, 2006 Share Posted August 4, 2006 $query = mysql_query ( "SELECT * FROM posts WHERE page_id='$id' ORDER BY auto_increment_field_stuff_thingy ASC" ) ;Replace auto_increment_field_stuff_thiny by whatever is your primary auto_increment key. Quote Link to comment Share on other sites More sharing options...
Salis Posted August 4, 2006 Author Share Posted August 4, 2006 So in my case[code]$query = mysql_query ( "SELECT * FROM posts WHERE page_id='$id' ORDER BY post_count ASC" );[/code]Thank you a lot. I figured it was something simple!Also, I refer back to PHPfreaks for nearly all the help. Awesome Site and Community! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.