I want to add a page view counter and I want to be able to add this information to mysql database.
Here is my table structure:
TABLE IF NOT EXISTS `properties` (
`property_id` int(11) NOT NULL auto_increment,
`visits` varchar(255) collate utf8_bin NOT NULL,
`last_visit` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`property_id`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
I would like it to count 1 per IP location so that it's fare and I also want to put a record of the last visit the page was viewed. So the page is viewed like this in the address bar: - www.sitename.com/page.php?id=1
So the function has to work for each ID and not update the database for all ID's. So the moment the user goes to the page the information is sent to the database.
If someone can help me write this I would really appreciate it as I haven't experienced writing logging code.
Thanks.