Got an Error but don't see the problem? [fixed]

Fatal error: Cannot redeclare getinfo()

Page 1 of 1

0 Replies - 532 Views - Last Post: 25 January 2010 - 11:42 AM Rate Topic: -----

#1 Jono20201  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 179
  • Joined: 07-July 09

Got an Error but don't see the problem? [fixed]

Posted 25 January 2010 - 11:42 AM

Got this error but i don't see whats wrong?

Quote

Fatal error: Cannot redeclare getinfo() (previously declared in /home/gaptoco1/public_html/Space/forum/beta/includes/content/include.php:17) in /home/gaptoco1/public_html/Space/forum/beta/includes/content/include.php on line 23


But i only have getInfo() once?

<?
session_start();
/* Connect to MySQL */
$dbname = '**********';
$dbuser = '***********';
$dbpasswd = '******';
mysql_connect('*****',$dbuser,$dbpasswd);
mysql_select_db($dbname);

/* Define */
if(!isset($_SESSION['userid'])){
	define('LOGGED_IN',false);
} else {
	define('LOGGED_IN',true);
}

function getInfo($info,$uid=0){
	if($uid==0){
		$uid=$_SESSION['userid'];
	}
	$query = mysql_fetch_assoc(mysql_query("select * from forum_users where user_id='".$uid."'"));
	return $query[$info];
}

function getRankName($rankId){
	if($rankId==0){
		return "Private";
	}
	$query = mysql_fetch_assoc(mysql_query("select * from forum_ranks where rank_id='".$rankId."'"));
	return $query['rank_title'];
}

?>


Turns out it was caused by a double declaring of start_session();

This post has been edited by Jono20201: 25 January 2010 - 12:15 PM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1