Fatal error: Call to undefined function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Niraj7878
Forum Newbie
Posts: 12
Joined: Thu Oct 09, 2014 11:48 pm

Fatal error: Call to undefined function

Post by Niraj7878 »


Fatal error: Call to undefined method Gallery::get_gallerycat() in D:\Tanvi\rb\db_access\Gallery.php on line 3

Code: Select all

[syntax=php]

function GetChildCategory($gallerycat_id=0 , $line = '', $cnt1='', $Selected ='') 
	{
		$category = $this->get_gallerycat($gallerycat_id);//this line getting error.
		$cnt = count($category);
		
		if($cnt)
		{
			for ($i = 0; $i < $cnt; $i++)
			{			
				$sel = ($gallerycategory[$i]['gallerycat_id']==$Selected) ? ' selected="selected"' : '';
				$str1 .= '<option value="' . $gallerycategory[$i]['gallerycat_id'] . '" ' . $sel . '>' . $line . ' '. $category[$i]['gallerycat_name'] . '</option>';
				$str1 .= $this->GetChildCategory($gallerycategory[$i]['gallerycat_id'],$line.'&nbsp;&nbsp;&nbsp;', $cnt1,$Selected);
			}
		}
		return($str1); 
	}

[/syntax]
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Fatal error: Call to undefined function

Post by Celauran »

OK, so the function is undefined. What's your question?
Post Reply