[eluser]Dagobert Renouf[/eluser]
Hello everyone.
I'm facing a problem I'm sure will find a quick and efficient answer, as I'm stucked right here !
When you want to display mysql query results, you do this :
Code:
foreach($query->result() as $row)
{
echo $row->id;
}
And this works fine.
However I'm having a ONE RESULT ONLY query running, and I want to do this to simplify things:
Code:
$row = $query->result();
echo $row->id;
Why does it return an error ?
Code:
Message: Trying to get property of non-object