Yohanne Posted April 24, 2013 Share Posted April 24, 2013 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(); Quote Link to comment Share on other sites More sharing options...
Solution Hall of Famer Posted April 24, 2013 Solution Share Posted April 24, 2013 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. Quote Link to comment Share on other sites More sharing options...
Q695 Posted April 24, 2013 Share Posted April 24, 2013 Any variable not declaired to be internal to the form needs to be called a global as its not a local variable. See: function Sum() { global $a, $b; $b = $a + $b; } Quote Link to comment Share on other sites More sharing options...
Yohanne Posted April 24, 2013 Author Share Posted April 24, 2013 thank you for all your responce and advice. and earlier from what you said, i check everyline and variable and i notice this $new = new new_request(); instead $new = new new_request_(); Couse->solve Thanks you Quote Link to comment Share on other sites More sharing options...
Yohanne Posted April 24, 2013 Author Share Posted April 24, 2013 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(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.