Current location: Hot Scripts Forums » General Community » Script Requests » Different type of link counter


Different type of link counter

Reply
  #1 (permalink)  
Old 10-10-03, 12:46 PM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
Different type of link counter

Is there any way to count, and display, the number of times a row has been accessed? For example, you have a site with book reviews, and a basic search brings up a results page, with several listings for an author, title, and "More Info" link. The user clicks the link to view more info on that book. By clicking that link, they are taken to another page that displays the entire table row for that book, to see more information. What I need is something to track how many times that link is clicked to basically display something like a "Most Popular" page, which counts how many times each row is viewed and displays the rows (book listings) with the most views. Will a standard link counter work, or is there a better way within mysql to track and display something like this? Maybe a count field in each row that auto-increments with each view?
Reply With Quote
  #2 (permalink)  
Old 10-10-03, 01:13 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
add a column called 'counter' for example and all you need is to add an UPDATE statment in the book display page which will bring the counter value and add 1 to it .. then you could call the counter value in any page you want ..
basicly something like that would work :
PHP Code:

mysql_query("UPDATE table1 SET counter=counter+1 WHERE book='$book'")or

die(
mysql_error()); 
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 10-10-03, 01:19 PM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
So when the second display page is brought up, that page needs the count query included into it, which will update the count field. Sounds easy enough, thnx.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Click counter php wildchrome Script Requests 6 05-13-09 02:21 PM
Make a query that makes a field a link to the entire row mdhall PHP 8 10-09-03 06:18 PM
text file to link rush989 Script Requests 3 08-29-03 06:12 PM
a visit counter darkcarnival General HotScripts Site Discussion 0 07-10-03 03:02 PM


All times are GMT -5. The time now is 11:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.