Hi
Im building a job portal website , but i want to add a feture of job views , same like products views on some platforms and same as on forum boards ( views of a post) .
what i need is the code of the views number , if its based on "onclick" event with a counter so its easy but i guess its should be more sufisticated than that,at least i tought so .
i hope someone can help me with this .
thx Avi .
detect numbers of views of item/post/job psoting
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: detect numbers of views of item/post/job psoting
I assume that you would have a field in either the job table or in a linked table that had an integer field to hold the count. The do something like this every time a job is viewed:
"UPDATE jobs SET jobs.view_count = jobs.view_count + 1 WHERE jobs.id = $job_being_viewed"
"UPDATE jobs SET jobs.view_count = jobs.view_count + 1 WHERE jobs.id = $job_being_viewed"
(#10850)