Re: Most viewed?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 15, 2008 at 9:41 AM, Steve Marquez <smarquez@xxxxxxxxxxxxxxx>
wrote:

> Greetings,
>
> Can any of you point me in the right direction on how to use PHP to create
> a
> most viewed or most clicked articles list? Can it be done with PHP?


are these articles on a site youre creating?  it should be pretty simple
then.  basically, when somebody clicks on a link to an article on the site,
drive that request through some php code that increments a counter in the
database.  then on the page where you show the 'most clicked' its
essentially just an ORDER BY most_clicked DESC LIMIT x query.  where
most_clicked is the field name of the counter, and x is the number of
results you want to show; so like for top 3, x=3.

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux