What this SELECT do?

Hi gurus,

Okay I have this codes below,

$this->db->select('c.lessonid as clessonid, l.*, c.completionid');

By the way the codes above is a SELECT command from CodeIgniter.
But the SELECT() is a MySQL command.

My question is what is this command below inside SELECT mean?,


What does the asterisk and number one do/mean?
Can someone please explain it in plain english.

Thanks in advance.

The select is used to fetch the columns of a table. Here l indicates the alias of table or table name and the * means all columns from that table. Here is the complete syntaxt:


it is the lower-case letter L followed by dot asterisk – the asterisk means all columns, and the lower-case letter L is the table alias of one of the tables in the SELECT

After running the query try this:

echo db_lastquery();

// http://ellislab.com/codeigniter/user-guide/database/helpers.html