CodeIgniter Forums
Retrieving records from db - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Retrieving records from db (/thread-52635.html)



Retrieving records from db - El Forum - 06-19-2012

[eluser]Kentish[/eluser]
Hello, need some help for the following:
Code:
return $result->row(0)->Name;

Normally, when returning a particular column in a db, we put the column name at the end of the command, as in this case Name.

What is the command when am selecting all columns? That is, when doing a SELECT * ?





Retrieving records from db - El Forum - 06-19-2012

[eluser]CroNiX[/eluser]
Code:
$row = $result->row();

echo $row->Name;
echo $row->Some_other_field;