<?php class Database2 extends CI_controller{ public function __construct(){ parent::__construct(); $this->load->database(); } function index(){ $value=array( 'name'=>'山田', 'gender'=>'女', 'birthday'=>'2001-07-09', ); $this->load->model('model_insert',$value); } } ?>
<?php class Model_insert extends CI_Model{ public function __construct(){ parent::__construct(); $this->load->database(); } function insert_data($value){ $sql =$this->db->insert('profile',$value); $this->db->query($sql); } } ?>
コントローラからモデルにデータを渡すにはどうすればいいでしょうか。
$this->load->model('model_insert',$value);これはできませんよね。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。