Angelojoseph17 Posted September 28, 2011 Share Posted September 28, 2011 I have a class called cid which contains these functions: public function UpdateDeliveryAddress($orderNumber, $deliveryaddress) { $sql = "UPDATE `CIDOrders` SET `DeliveryAddress` = '" . mysql_real_escape_string($deliveryaddress) . "' WHERE `CIDOrderNumber` = " . $orderNumber . ";"; mysql_select_db(DB_DATABASE_NAME, $this->conn); return mysql_query($sql, $this->conn); } public function UpdateInvoiceAddress($orderNumber, $invoiceAddress) { $sql = "UPDATE `CIDOrders` SET `InvoiceAddress` = '" . mysql_real_escape_string($invoiceaddress) . "' WHERE `CIDOrderNumber` = " . $orderNumber . ";"; mysql_select_db(DB_DATABASE_NAME, $this->conn); return mysql_query($sql, $this->conn); } It is called in a page called create order. / Add a new delivery address to the order $cid->UpdateDeliveryAddress($_POST['orderNumber'], $_POST['deliveryaddress']); // Add invoice address to the order $cid->UpdateInvoiceAddress($_POST['orderNumber'], $_POST['invoiceaddress']); I get a call to undefined method error. Can anyone help me. thank you Quote Link to comment https://forums.phpfreaks.com/topic/248047-call-to-undefined-method/ Share on other sites More sharing options...
AyKay47 Posted September 28, 2011 Share Posted September 28, 2011 before i look at the code, give the exact error please Quote Link to comment https://forums.phpfreaks.com/topic/248047-call-to-undefined-method/#findComment-1273618 Share on other sites More sharing options...
Angelojoseph17 Posted September 28, 2011 Author Share Posted September 28, 2011 PHP Fatal error: Call to undefined method CHCID::UpdateDeliveryAddress() Quote Link to comment https://forums.phpfreaks.com/topic/248047-call-to-undefined-method/#findComment-1273625 Share on other sites More sharing options...
AyKay47 Posted September 28, 2011 Share Posted September 28, 2011 what is your class name and where is $cid coming from? Quote Link to comment https://forums.phpfreaks.com/topic/248047-call-to-undefined-method/#findComment-1273635 Share on other sites More sharing options...
Angelojoseph17 Posted September 28, 2011 Author Share Posted September 28, 2011 class name is CHCID . its coming from the top of the create order page where i've initialised the class. require_once $CID_INCLUDE_PATH . "/cid.php"; $cid = new CHCID(); Quote Link to comment https://forums.phpfreaks.com/topic/248047-call-to-undefined-method/#findComment-1273636 Share on other sites More sharing options...
PFMaBiSmAd Posted September 28, 2011 Share Posted September 28, 2011 Use get_class_methods to see what methods php thinks exist for the class. You either have a spelling error, multiple include files in different folders, or the actual class that got uploaded to the server isn't the one that contains that method(s). Quote Link to comment https://forums.phpfreaks.com/topic/248047-call-to-undefined-method/#findComment-1273701 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.