Displaying the result in a particular fromat

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xs2manish
Forum Commoner
Posts: 26
Joined: Mon Aug 22, 2005 10:46 pm

Displaying the result in a particular fromat

Post by xs2manish »

i have to display results of a query where in the paid listings get displayed first and then the free listings. Also there is a limit or 10 results per page. that means if there are 5 paid listings in the database then the first page will have the first five as paid results and the next 5 a free results and on the subsequent pages the result will be free pages.

Please help me to solve this.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you will need some flag that says "this record has priority" the use the ORDER BY construct of your database to (first) sort by that field.

As for the rest of your issue, it's a standard pagination thing.. there's been many many threads on pagination here.. including a basic class to handle them by Jcart in the Code Snippets board..
Post Reply