我在PHP上有類,當調用它時,函數__construct($_POST)
必須處理。__construct在調用類時出錯
的__construct()
功能定義爲:
// Constructor Function
function __construct($_POST){
$this->customer = trim($_POST['customer']);
$this->CreateDate = date('Y/m/d');
}
當我呼籲類中的任何功能,其處理並插入到數據庫,但這種按摩是出現: -
Missing argument 1 for Draft::__construct(), called in ....
什麼錯我的代碼
thankx
你如何實例化你的對象? – christopher 2013-03-01 23:17:50
你如何開始上課?爲什麼在你的構造函數中傳遞$ _POST?''__construct(){'而不是'function __construct($ _ POST){'將很有可能解決您的問題 – 2013-03-01 23:18:05