I would like to know which option is the most expensive in terms of bandwidth and overall efficiency.
Say I have a Client
class in my application and a Client
table in my database.
Is it better to have one static function Client.getById
that retrieves the entire client record or many ( Client.getNameById
, Client.getMobileNumberById
, etc.) that retrieve individual fields?
If there are many fields in one record, and I end up using one or two in the current script, it's still better to get everything and decide inside the application, what should I do with all the data?
I am using PHP and MySQL by the way.
source share