Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to retrieve number of times an article is accessed php/mysql

Status
Not open for further replies.

dreamaz

Technical User
Dec 18, 2002
184
CA
Hi,

I have a mysql database which I use to store articles. I use a php form to search for those articles and display the search results by Title, Description, Keywords (all fields on the mysql table)

I would now like to have a # of times accessed field which I can call and display. Any help on how to call the field and have that field increment everytime its accessed is needed

Thank you,

dR
 
you will need to add a new field in your table to count the number of "hits" on your article, or possibly create a new table to count hits.

every time the article is accessed, you will have to increment the value by one. you can then display this number wherever you want.



*cLFlaVA
----------------------------
spinning-dollar-sign.gif
headbang.gif
spinning-dollar-sign.gif

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
I've got a field called 'accessed' and need some help on the code to increment the value when accessed
 
Thanks for the reply.

Now that I see what you are saying..I should mention that the search result is not the actual article, but a hyperlink to a file (which contains the article thats stored on the server.

I guess the idea is that once that hyperlink is clicked (the file is opened ie. PDF in the browser) and at the same time the value of 'accessed' should be incremented by 1.

Thanks,

dR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top