Jump to content
Larry Ullman's Book Forums

wushu

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by wushu

  1.  

    You need to follow these steps to implements such functionality:

     

    1. Keep track of views. This can be saved in your post/article/etc table along with other info, or in a separate table with a foreign key to the article ID. Each time an article is loaded using PHP, simply update the views column in the table. (You might also use flat-files, the principle is the same)

     

    2. Query for articles based on views. The basic query looks something like this:

    SELECT * FROM articles ORDER BY views DESC LIMIT 10

    i understand a bit what is a database and what is a table, the Query u gave me is exactly what i 'm using, the problem that bothers me is the php code.. i mean how to connect between the HTML and MySQL

     

    thanks alot for helping

×
×
  • Create New...