this link below is sli.
http://24.91.157.113/findyourdesire/SQLqueryissue
it shows the response i got..
what i'm trying to do for the forums i'm making is have one query that returns threads by the date they were made ... first giving me the ones that are stickied, both in descending order.
i'm not sure that's possible but figured that with getting this on the test db i made that someone might be able to tell me how to adjust it to work. on that i'm using the tid instead of the date. obviously it's not a real table, the real ones are MUCH more complicated
need help morphing this to a useable query
Moderator: General Moderators
You can't use AND in the order by clause. Either move it to the where clause or seperate the multiple sorts by a comma.
Code: Select all
mysql> select * from thrdtst where fid='4' order by tid, sticky desc;OK then, flip the order of your sorts, I think the following order by will workm3rajk wrote:thnx. hmmm. i wanted stickes at the begining of the page display, but considering what i'd be stickying is likely to be rule/regulations type stuff for the forums.... maybe i'll have them on each page....
Code: Select all
order by stickies desc, tidthat worked perfectly.. although talking to some friends and asking questions of preference to them about important threads.. if they'd prefer it on each page of the forum or only on the first, they seemed to prefer all, only one said just the first. so they way i set it up is how i'll keep it unless i decide to make an anouncement bit and then have three levels like phpbb does.
it''s a good thing toknow though. thank you for the help
it''s a good thing toknow though. thank you for the help