Jump to content

Make a sticky thread, own forum


red-x

Recommended Posts

well how i owuld go about doing this is

call all the sticky rows and echo them in a while statement then

call the non sticky rows and echo them in a while statement

 

like so

 

$q="SELECT * FROM table WHERE type='sticky' ORDER BY time";
$query=mysql_query($q);
while($myrow=mysql_fetch_array($query)){
$myrow[]
echo your threads
}

$qnonsticky="SELECT * FROM table WHERE type='nonsticky' ORDER BY time";
$nonstickyquery=mysql_query($qnonsticky);
while($myrow=mysql_fetch_array($nonstickyquery)){
$myrow[]
echo your non sticky threads
}

 

anyways that is how about would go about doing that, it is simple and it works. then if you wanna stick a thread just change the type from nonsticky to stick and it will put it to the top

 

idk.. i tried

A numeric data type for stickied or not would be quicker.  I guess it could be an announcement or something though....  So I guess multiple options might be needed.

 

 

Why bother with two queries?  If you make it numeric, you can just order by stickied and if it is stickied, it will be in the top of the result set ;p.

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.