Page 1 of 1

need php counter

Posted: Sat Jul 26, 2003 7:58 pm
by Dominator69
im looking for script like counter i want to have like top 10 songs i want to show it on the main page top 10 clicks on the songs so i need to know what kind of the script i have to look for thanx

Posted: Sat Jul 26, 2003 9:43 pm
by McGruff
If you create a views column (int), you can use this query (assuming you are using mysql) to increment views by 1each time an item is clicked on:

"UPDATE tablename SET views=views+1 WHERE aid='$aid'

To find the top ten, perform a LIMIT query and ORDER BY views.

Posted: Sun Jul 27, 2003 1:56 am
by m3mn0n
LIMIT 0, 10


Every page add that you want counted

add a

Code: Select all

<?php
require ("counter.php");
?>
to it

(asuming your script is in counter.php)