CodeIgniter Forums
Retrieving records from db - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Retrieving records from db (/showthread.php?tid=52635)



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;