I have a question related to a project I am currently working on.
In my script all posts are currently being displayed this way:
$sql = "SELECT * FROM posts"
. "\n WHERE page_slug = '" . $this->slug . "'"
. "\n AND active = '1'"
. "\n ORDER BY id DESC" . $pg->limit;
$result = $db->fetch_all($sql);
This is fine although the problem now is , that I want a certain item to be displayed first before all others. I tried to give this specific item a very high ID (e.g. 1000), although if I create a new post the new posts ID suddenly starts with 1001 and it jumps on first position.
Does anybody have an idea on how I can avoid this from happening or at least how I can “trick” a specific item to be at the first position by somehow tweaking the sort-order?
Some advise would be highly appreciated.
Thank you very much,
Patrick
Of course you don’t have to use 1000 as the id in the case statement, but you mentioned that was the id of the one you want on top…