Order them by most viewed? Add a 'views' column to your table and increment it when someone sees the ads.
Oct 23, 2016
3
Level 4
How to create a featured/Top article in a classifieds php application
I'm creating a PHP classified ads application but i'm stuck on how to create the 'Top Ads/Featured Ads section' to be shown at every search page depending on the category. My first instinct was to create an sql query to randomize these 'Top ads' , Limit the result to 2 and display it on each search page. However its seems this is going to break quickly as i'm using " order by Rand() " in my query to randomize the result. Please how can i achieve this using a more practical approach ?
Please or to participate in this conversation.