Page 1 of 1

detect numbers of views of item/post/job psoting

Posted: Sat Jul 14, 2012 4:37 pm
by avibitton
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 .

Re: detect numbers of views of item/post/job psoting

Posted: Sat Jul 14, 2012 9:42 pm
by Christopher
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"