Hello Friends,
If you are looking to execute select query in codelgniter. Please review the code below:
// Pass the table attributes you need to fetch
$this->db->select('id, first_name, lastname');
OR
$this->db->select('*');
// Define your db table name in the place of users
$this->db->from('users');
// Define your where condition
$this->db->where('id', $id);
OR
$condition_array = array('first_name' => $name, 'status' => '1');
$this->db->where($condition_array);
// Execute the query
$queryExe = $this->db->get();
// Fetch Data
return $queryExe->result();
0 Comment(s)