打开AR
查询
//查询get
$res = $this->db->get('users');
echo "<pre>";
print_r($res->result());
$res = $this->db->get('users');
echo "<pre>";
print_r($res->result());
echo "</pre>";
//插入insert
$data = array(
'name'=>'haha',
'password'=>md5(123456)
);
$bool = $this->db->insert('users',$data);
$data = array(
'name'=>'haha',
'password'=>md5(123456)
);
$bool = $this->db->insert('users',$data);
var_dump($bool);
//修改update
$data = array(
'name'=>'zhangpeisen',
'password'=>md5(987654)
);
$where = array('id'=>15);
$bool = $this->db->update('users',$data,$where);
$data = array(
'name'=>'zhangpeisen',
'password'=>md5(987654)
);
$where = array('id'=>15);
$bool = $this->db->update('users',$data,$where);
var_dump($bool);
//删除delete
$where = array('id'=>15);
$bool = $this->db->delete('users',$where);
$where = array('id'=>15);
$bool = $this->db->delete('users',$where);
var_dump($bool);