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 ??? 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 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. 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 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 Link to comment https://forums.phpfreaks.com/topic/159953-solved-php-counter-help/#findComment-843650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.