Jump to content

Call to undefined method


Yohanne

Recommended Posts

please help to define, where couse the error: i foud like this error

 

Fatal error: Call to undefined method new_request::the_suppliment()

	public function the_suppliment()
					{
						foreach($_POST as $key => $values)
							{
								$mydata[$key] = $this->cleared($values);
							}
						if(isset($mydata['new']) && 'New' == $mydata['new'])
							{
								$this->set_query = ("INSERT INTO ocs_item_list(user_id,request,cat_name,prd_name,quantity,date_request) VALUES('$mydata[id]','$mydata[request]','$mydata[cat]','$mydata[subcat],'$mydata[quantity],'$mydata[thedate]')");
								
								$this->var_result = mysql_query($this->get_query()) or die("$this->get_query". mysql_error());
							}
					}
			}
		
		$nnew = new new_request();
		$nnew->the_suppliment();
Link to comment
https://forums.phpfreaks.com/topic/277236-call-to-undefined-method/
Share on other sites

The error means that the method new_request::the_suppliment() does not exist. Since you only show a fragment of your code its difficult to help you with. Are you sure the method the_suppliment() is defined inside class new_request? You dont seem to have made a typo though, so thats the only clue I have for now.

  On 4/24/2013 at 4:04 AM, jayson_ph said:

 

please help to define, where couse the error: i foud like this error

 

Fatal error: Call to undefined method new_request::the_suppliment()

{
public function the_suppliment()
	{
	 foreach($_POST as $key => $values)
	   {
	     $mydata[$key] = $this->cleared($values);
	   }
	     if(isset($mydata['new']) && 'New' == $mydata['new'])
	   {
            $this->set_query = ("INSERT INTO ocs_item_list(user_id,request,cat_name,prd_name,quantity,date_request) VALUES('$mydata[id]','$mydata[request]','$mydata[cat]','$mydata[subcat],'$mydata[quantity],'$mydata[thedate]')");
								
            $this->var_result = mysql_query($this->get_query()) or die("$this->get_query". mysql_error());
	   }
       }
}
		
$nnew = new new_request();
$nnew->the_suppliment();

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.