Welcome Guest, Not a member yet? Register   Sign In
possible to rename db-table in active record ?
#6

[eluser]louisl[/eluser]
To be honest I've never tried it, I've never been a fan of shortening all the table names. Active record makes the code layout pretty nice and readable so mine typically look like this:-

Code:
public function getUsersInGroup($group_id) {

  $this->db->select('users.username');
  $this->db->select('user_profiles.FirstName');
  $this->db->select('user_profiles.Surname');
  $this->db->from('users');
  $this->db->join('user_profiles', 'users.id = user_profiles.user_id', 'left');
  $this->db->join('user_groups_lookup', 'users.id = user_groups_lookup.user_id', 'left');
  $this->db->where('user_groups_lookup.group_id', $group_id);
    
  $query = $this->db->get();
  
  return $query;

}


Messages In This Thread
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 07:09 AM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 07:14 AM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 07:16 AM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 08:27 AM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 08:33 AM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 12:42 PM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 02:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB