Codeigniter $this->db->get(), how do I return values for a specific row?
问题 Say I have a database table with three columns: ID, Name, and Age. I need to find the user with a specific (unique) ID, and then return the age. Currently, I am using the following code $this->db->where('id', '3'); $q = $this->db->get('my_users_table'); How do I go about getting the age for this user? I think I have to use $q->result() But not sure how to use it with one row. 回答1: SOLUTION ONE $this->db->where('id', '3'); // here we select every column of the table $q = $this->db->get('my