I am trying to form the query:

Select firstname, lastname, email from table where user_id = 1

so when i do:

   $select=$this->_db->select();
   $select->from('table', 'table.firstname');
   $select->from('table', 'table.lastname');
   $select->from('table', 'table.email');
   $select->where('table.user_id = '.$userId);

it is generating this query:

SELECT
       table.`firstname`,
       table_2.`lastname`,
       table_3.`email`
FROM `table` table
INNER JOIN `table` table_2
INNER JOIN `table` table_3
WHERE
     table.user_id = 11


which clearly does not return the same result.  Is this a bug?  Or am I
using select incorrectly.

Thanks,
Adam.

Reply via email to