PHP: Creating a message board

silentScope

Member
Apr 2, 2002
129
0
0
You know whenever you look through topics and stuff you notice that the most recent post is always at the top and everything is sorted by date and time... how is that done internally? I am trying to create a message board from scratch using PHP and MySQL, I am not looking for anything fancy like phpbb.... its a learning procedure as well for me
Does anyone know when the posts are sorted .. is it done in the php scripts everytime a page is loaded? Thanks for your time.

Also any advice on doing this message board is helpful thanks :)
 

holycow

Senior member
Feb 28, 2001
330
0
0
date sorting is done when you retrieve the messages from your database, using "order by date desc, time desc" in your sql statement. this is how i do it in a asp message board i wrote.

 

silentScope

Member
Apr 2, 2002
129
0
0
HolyCow, is there a way that i can contact you? Icq? MSN? etc...

I was also wondering.... you know how there are general Catogories like on Anandtech forumn they have

Video, CPU/overclocking...

is Video a Table... and than it has a table within that Table ( video) to store all the TOPICS... and than a table within the table of (TOPICS) which are all the posts.... is that how it works? I have no idea how sql works wit forumns and im tryin to figure that out

tnx :)
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
no such thing as a 'table within a table'

I don't know for sure, but if you look in the URL for the forums as you cruise about you'll notice "catid" "threadid" "messid" and "parentid"

My guess is those are all primary keys to thier respective tables.

bart
 

holycow

Senior member
Feb 28, 2001
330
0
0
it's not table within table.. it's done like a linked list.. you have a topic and it links/references to the messages..