Jump to content

Call to undefined method


Yohanne
Go to solution Solved by Hall of Famer,

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
Share on other sites

  • Solution

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.

Link to comment
Share on other sites

 

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.