Hello everyone!!
iam new in php. i need code in php mysql for video visitor hit counter. if saw code online below
<?php $getViews = mysql_query("SELECT `hits` FROM `hit_counter` WHERE `id` = {$videoID}"); if(mysql_num_rows($getViews)) { $result = mysql_fetch_assoc($getViews); $videoViews = $result['hits']+1; } else { $videoViews = 1; } mysql_query("INSERT INTO `hit_counter` (`id`) VALUES ({$videoID}) ON DUPLICATE KEY UPDATE hits = hits+1"); echo 'Total Views: '.number_format($videoViews); ?>i don’t know what’s wrong with this code any body here who help me to give proper code.
please help me out