[eluser]CroNiX[/eluser]
That's up to you and how you need your data, which could vary from instance to instance.
Regarding num_rows() vs native count(), num_rows() will always be faster and cheaper because it's already calculated as part of the query result, while count() would have to basically redo what num_rows() already did, which will take longer and consume more memory.
So I would do this, except return null if nothing was found, since 0 could be a legitimate value in some query results.
Code:
if ($query->num_rows() > 0)
return $query->row();
}
return 0;