Displaying certain results at the top....
Moderator: General Moderators
Displaying certain results at the top....
I have an article script. What I am wanting to do is to display from a mysql database the "Featured articles" before the normal articles which I will order by the time they where added.
How can I do this without having to use two mysql querys? The results are also in pages.
I tried something like this:
mysql_query("select * from ".$tbl_name."_articles order by featured,uptime desc limit $vstart,$Spagecut");
Didn't work...
How can I do this without having to use two mysql querys? The results are also in pages.
I tried something like this:
mysql_query("select * from ".$tbl_name."_articles order by featured,uptime desc limit $vstart,$Spagecut");
Didn't work...
In other words, what fields does it have, can you give an example row?
Ex:
Ex:
Code: Select all
+-----+----------+---------+
| ID | Article | Text |
+-----+----------+---------+
| 1 | PHP Tips | blah... |
+-----+----------+---------+Code: Select all
id | title | cat | description | author | type | featured | article | uptime
1 | PHP Tips | 1 | description here | My Name | 1 | 1 | Article text blah blah | 1046405638