0
がすべて必要です。ファイルがコントローラであるか、モデルで操作する必要がありますか?codeigniter: 'null'の値が0に設定されている場合コード内の
public function newUser(){
$param['name'] = $this->input->post("name");
$param['email'] = $this->input->post("email");
$param['user'] = $this->input->post("user");
$param['password'] = sha1($this->input->post("password"));
$param['state'] = $this->input->post("state"); //<-- this value is a checkbox, if is unckecked the value became 'null'. What I want is to change that 'null' value to 0 before to send to the database.
$this->mdatabase->newUser($param);
}
ありがとう:D。
これは私のように私を動作させます: \t \t $ param ['state'] = $ this-> input-> post( "state"); \t \t if(!isset($ param ['state'])){$ param ['state'] = 0; } ありがとう:D – raulmartiarena