Tag Archives: codeigniter

Get count of rows from joined tables in Codeigniter

Share on TwitterDigg This

we can select count the number of rows in a joined table using codeigniter active record For simple example consider two tables vehicles and trips.By join this two tables we need to list the vehicle with total count of trips … Continue reading

Codeigniter base url config for Multiple Sub-Domains

Share on TwitterDigg This

In application config.php file Set the base_url value using server http_host information to run CodeIgniter app over multiple sub-domains $config[’base_url’] = ‘http://’ . $_SERVER[’http_host’] . ‘/’;

codeigniter session issue : Codeigniter Session Value As Images?

Share on TwitterDigg This

In my project,I am trying to fetch get values and set session value by this function set_uri_session(){ $id=$this->uri->segment(3); $this->session->set_userdata(’id’,$id); echo $this->session->userdata(’id’); } </php> when I print this session value in that page itself, I got the value correctly.and when I … Continue reading

codeigniter active record sub query using where not in

Share on TwitterDigg This

using sub query in where clause in codeigniter $this->db->where(); This function enables you to set WHERE clauses $names = array(’Frank’, ‘Todd’, ‘James’); $this->db->where_in(’username’, $names); // Produces: WHERE username IN (‘Frank’, ‘Todd’, ‘James’)   $this->db->where(’`store_id` NOT IN (SELECT `store_id` FROM `user_store`)’, … Continue reading

How to Refresh Current Page in CodeIgniter

Share on TwitterDigg This

To refresh the current page in codeigniter call the controller function which redirect to current url redirect($this->uri->uri_string());