codeigniterフレームワークを使用していますが、フォームを送信すると次のエラーが発生します。
メッセージ:未定義のプロパティ:Users :: $ Usersa
ファイル名:controllers / users.php
行:44
致命的なエラー:非オブジェクトのメンバー関数insert()を呼び出します
ユーザーコントローラー(壊れているセクション):
$this->load->model('usersa');
$register = array(
'username' => $this->input->post('username'),
'password' => $this->input->post('password'),
'email' => $this->input->post('email')
);
// validation stuff
if ($this->input->post())
if ($this->form_validation->run() == FALSE) {
} else {
$this->Usersa->insert($register); // This is line 44
}
Usersaモデル(このファイルはアプリケーション/モデルにあります)
class Usersa extends MY_Model {
var $table = 'users';
function __construct() {
parent::__construct();
}
}
MY_Model(アプリケーション/コアにあります)
class MY_Model extends CI_Model{
protected $table = '';
function __construct() {
parent::__construct();
}
function insert() {
$this->db->insert($this->table, $register);
}
}
テーブルデータは正常に渡されており、レジスタデータも同様であると確信しています。エラーメッセージが表示される理由がわからないようです。