otuatail Posted November 2, 2007 Share Posted November 2, 2007 I have written a message board and it has been test properly, the problem is it looks naff in apearance. When I see this message board I would like to model it on this. I can't work out the top section. It seems to be in 3 sections pinned to top, pinned to top and read only, and the rest with the occasioal read only. I can't work out the best query. all entries will be in the same table with a field type maybee of 1=Pinned 2=Pinned read only 3=other. But then there is the ocasional read only. their is one of these now 18 recs down. Any Idea on a table structure. Would it require 3 seperate queries. Not good. Desmond. Quote Link to comment https://forums.phpfreaks.com/topic/75821-message-boards/ Share on other sites More sharing options...
GingerRobot Posted November 2, 2007 Share Posted November 2, 2007 Its a simple case of having some sort of status field and using the ORDER by clause on your query. This should relate only to if a topic is pinned. You will need a different field for locking threads. The reason why it appears that we have pinned, followed by pinned and read only, followed by others is simply because those which are pinned and NOT read only, have, of course, been posted in more recently that the read only topics. The query to grab the topics would order by status(pinned or not) then by last post. Wether or not a topic is read only has nothing to do with the ordering. Quote Link to comment https://forums.phpfreaks.com/topic/75821-message-boards/#findComment-383750 Share on other sites More sharing options...
otuatail Posted November 2, 2007 Author Share Posted November 2, 2007 I think I am going to need 3 fields 2 for the Pined and locked and a 3rd for normal locking......... `id` int() NOT NULL auto_increment, `pinned` varchar(1), 'lock' varchar(1), `subject` varchar(255), `content' text' 'lock2` varchar(1), // for normal locking $SQL = "SELECT * FROM Table ORDER BY pinned, lock"; Quote Link to comment https://forums.phpfreaks.com/topic/75821-message-boards/#findComment-383757 Share on other sites More sharing options...
cooldude832 Posted November 2, 2007 Share Posted November 2, 2007 I think I am going to need 3 fields 2 for the Pined and locked and a 3rd for normal locking......... `id` int() NOT NULL auto_increment, `pinned` varchar(1), 'lock' varchar(1), `subject` varchar(255), `content' text' 'lock2` varchar(1), // for normal locking $SQL = "SELECT * FROM Table ORDER BY pinned, lock"; Since we are talking about speeding things up don't use a varchar use an int(1) or bool, as this is simpler storage methods. and the * operator aint' good eitehr Quote Link to comment https://forums.phpfreaks.com/topic/75821-message-boards/#findComment-383759 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.