Jump to content

[SOLVED] working on a forum and need some "sticky" help.


zhTonic

Recommended Posts

Hey guys,

 

What i'm trying to do is when i select all of the threads to be displayed, i have some flagged as stickies and i want them to always be at the top no matter what.

 

I'm not sure if this is achieved via mysql or php, any help would be appreciated.

 

Thanks.

How are they being marked as stickied threads? Generally, the approach is to have some field in your topics table called sticky (or, perhaps, status if you wish to have different levels of thread importance). You would then set the field to 1 for any stickied threads and 0 for those which are not. When you select the topics, you order by sticky (or status) first and date second.

How are they being marked as stickied threads? Generally, the approach is to have some field in your topics table called sticky (or, perhaps, status if you wish to have different levels of thread importance). You would then set the field to 1 for any stickied threads and 0 for those which are not. When you select the topics, you order by sticky (or status) first and date second.

 

That's how i have it in the database right now, there is a sticky field in the row... Also thanks for reminding me about ORDER BY i totally forgot about it.

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.