ci 學習筆記

1:$this->session->sess_destroy();/清空session
2:session_unset(); //重置所有session,即清空原有值:
3.$this->input->is_ajax_request()//是否是ajax請求
4.$this->input->method(TRUE); // Outputs: POST返回表單提交方式
5.$this->input->method(FALSE); // Outputs: post
6.$route['default_controller'] = 'welcome';//設置ci默認控制器application->config->routes.php
7. $cur_method =  $this->router->fetch_method();獲得當前請求的方法名
8. $this->db->where_in("ROOMID",$array);
9.// num rows example//獲取記錄的行數
$this->db->select('*');
$this->db->where('whatever');
$query = $this->db->get('table');
$num = $query->num_rows();
// here you can do something with $query

// count all example
$this->db->where('whatever');
$num = $this->db->count_all_results('table');
// here you only have $num, no $query
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章