Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi,
how to display most popular articles using php 
and thanks in advance  


What I have tried:

select * from articles where views=?
Posted
Updated 20-Apr-18 8:10am
Comments
Richard Deeming 20-Apr-18 12:05pm    
We have no idea how your database is structured, or how you define the popularity of the articles.

Click the green "Improve question" link and update your question with a proper description of the problem.

1 solution

Look into how to use the ORDER BY clause, sorting them most to least.
Then get the n most popular

You're assuming, wrongfully, that views == popularity.
 
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