Welcome Guest, Not a member yet? Register   Sign In
Multiple Database Connections
#6

[eluser]Randy Casburn[/eluser]
If you insist on this configuration, then you must insist upon yourself that you disconnect your db by issuing $this->db->close(); whenever you have completed your db operations.

i.e.

Code:
function get_user($id)
{
  $this->load->database('default');
  $query = $this->db
                ->from('users')
                ->limit(10)
                ->where('id' , $id)
                ->get();
// THIS MUST BE DONE IF YOU INSIST ON YOUR METHOD //
  $this->db-close();  
  if ($query->num_rows() > 0)
  {
    $rows = $query->row_array();
    return $rows;
  }
  return false;
}


Hope this helps,

Randy


Messages In This Thread
Multiple Database Connections - by El Forum - 06-16-2008, 01:49 AM
Multiple Database Connections - by El Forum - 09-26-2008, 04:12 PM
Multiple Database Connections - by El Forum - 09-26-2008, 06:24 PM
Multiple Database Connections - by El Forum - 10-01-2008, 03:32 PM
Multiple Database Connections - by El Forum - 10-01-2008, 04:42 PM
Multiple Database Connections - by El Forum - 10-01-2008, 05:41 PM
Multiple Database Connections - by El Forum - 10-02-2008, 10:38 AM
Multiple Database Connections - by El Forum - 10-02-2008, 04:24 PM
Multiple Database Connections - by El Forum - 10-03-2008, 05:58 AM
Multiple Database Connections - by El Forum - 10-04-2008, 07:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB