<?php class Database2 extends CI_controller{ function index(){ $this->load->database(); $name ='佐々木'; $gender='男'; $birthday='1999-02-01'; $sql='INSERT INTO profile(name,gender,birthday) VALUES(' . $this->db->escape($name) .', '. $this->db->escape($gender) .', '. $this->db->escape($birthday) .')'; $this->db->query($sql); } } ?>
コントローラーに全部記述しましたが、役割的にモデルに記述した方がいい部分ってありますか?
回答2件
あなたの回答
tips
プレビュー