PHP mysql_query按顺序查看麻烦

I have mysql_query problem in php. Of course I have visitors in my website and they read football news there. The problem is that I try to sort news by views DESCending, but it doesn't work for new uploaded news. Somehow it appears at the end of the page. I've figured out one more thing that when views of the news is 9 it appears at the beginning of the page, but if it is more than 9 it appears at the end of the page. I'd appreciate any kind of help. Here is mysql_query.

mysql_query("SELECT * FROM news ORDER BY views DESC");

Oh and by the way, my website is http://www.bbcsport-football.com/football

there you can find Sorting options, New and Most Viewed. Click most viewed and you'll see it.

You need to convert the views column to a number

mysql_query("SELECT * FROM news ORDER BY cast(views as INTEGER) DESC")

Or even better change the table definition so views is a INTEGER

You're sorting the news by the count of "views", if I'm right, views is the count of users that already have read the page right? Try sorting it by the publication date instead, like:

"SELECT * FROM news ORDER BY pub_date DESC"

your code seems to be o.k to me... just check this query in your phpmyadmin database and check results what you get manually.

i see your URL and it looks o.k as per order by view. but one thing i notice is your pagination.

when i click pagination (page 2) from most viewed. it will automatically redirected to the first page of new. hope this little testing will help you in your website.. :)