jamesxg1 Posted May 27, 2009 Share Posted May 27, 2009 function Count($VAR) { if(mysql_result(mysql_query("SELECT COUNT(1) FROM `counter` WHERE pid = '$VAR' AND ip = '".$_SERVER['REMOTE_ADDR']."';"), 0, 0 ) > 0) { if(mysql_query("UPDATE `counter` SET number=number+1 WHERE pid = '$VAR' AND ip = '".$_SERVER['REMOTE_ADDR']."';")) { } }else{ if(mysql_query("INSERT INTO `counter` SET number=1, pid = '$VAR', ip='".$_SERVER['REMOTE_ADDR']."';")) { } } } i get this error Fatal error: Cannot redeclare count() in C:\xampp\htdocs\social\Utilitys\Functions.php on line 15 help ??? Quote Link to comment https://forums.phpfreaks.com/topic/159953-solved-php-counter-help/ Share on other sites More sharing options...
jamesxg1 Posted May 27, 2009 Author Share Posted May 27, 2009 $member = protect($_GET['memberid']); Count($member); thats all iv put on the page i want it to work on :S Quote Link to comment https://forums.phpfreaks.com/topic/159953-solved-php-counter-help/#findComment-843623 Share on other sites More sharing options...
Ken2k7 Posted May 27, 2009 Share Posted May 27, 2009 Read count. It's a built-in PHP function. You can't re-define it. Quote Link to comment https://forums.phpfreaks.com/topic/159953-solved-php-counter-help/#findComment-843635 Share on other sites More sharing options...
MadTechie Posted May 27, 2009 Share Posted May 27, 2009 so rename your function to counter instead of count Quote Link to comment https://forums.phpfreaks.com/topic/159953-solved-php-counter-help/#findComment-843643 Share on other sites More sharing options...
jamesxg1 Posted May 27, 2009 Author Share Posted May 27, 2009 it worked thanks guys your both *'s thankyou for your time Quote Link to comment https://forums.phpfreaks.com/topic/159953-solved-php-counter-help/#findComment-843650 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.