Click here to Skip to main content
15,921,643 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
HI ALL,
I have made a website in which user can upload their advertisement.I have added search form in which everyone can search products from my website.But i want to display my paid user data in top whenever any person use search form of my website.I am working on it.I need your suggestion and help.Please help me.
Thanks all,
Posted
Comments
Vishal Pand3y 6-Dec-13 13:28pm    
can you Provide some more information whether you want your paid user's advertisement First ? or what
and Most Importantly what have you tried
[no name] 6-Dec-13 13:50pm    
Yes,I want to display the data of my paid user advertisement first.
Sergey Alexandrovich Kryukov 6-Dec-13 14:00pm    
And?..
—SA

1 solution

So, you either do two searches: one through Premium ads, and one through non-premium ads and display them in that order, or you do one search but add a "order by" criteria which puts premium ones first.

We can't be specific as we have no idea how you are storing, accessing or displaying any of your information!
But, if it's SQL, then something along the lines of:
SQL
SELECT * FROM MyAds WHERE searchText LIKE '%I want this%' ORDER BY premiumRate, searchText
should help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900