Choose from multiple columns: codeIgniter

I want to select multiple columns in a table using active codeIgniter records. Selection with

    $this->db->select('*');
    $this->db->from($this->table_name);

but choosing the number of columns for example

   $this->db->select('username','email','last_login','created','modified','group_id');
    $this->db->from($this->table_name);

does not work. It returns only an array with values ​​from the first column. How should I do it?

according to the CodeIgniter user guide, they gave the following example. so I thought this should work in my case.

$this->db->select('title, content, date');

$query = $this->db->get('mytable');

// Produces: SELECT title, content, date FROM mytable
+3
source share
1 answer

, , select() , . username. :

$this->db->select('username, email, last_login, created, modified, group_id');

, , Active Record. , Codeigniter!

. :

1. :

$this->db
    ->select('username','email','last_login','created','modified','group_id');

2. (, ):

$this->db
    ->select('username, email, last_login, created, modified, group_id');

() 2. 1 , , , .

+6

All Articles