Welcome Guest, Not a member yet? Register   Sign In
Smart $ Fast database select and get single data - field entry :)

here is thing, when I have just one or maybe two database entry to get i use this code Smile

$this->db->where('data', $data)->get($this->_table)->row()->table_field;

but what do you think, when we get data from DB from this code, does this code select all table fields or just included one?!?

if you don't specify fields to select, SELECT * is used, which is all fields.

You dont use select so it gets every field to the result(using *). If you dont want that, add select('table_field') for example:
$this->db->select('table_field')->where('data', $data)->get($this->_table)->row()->table_field;

yes, that is that answer, thanks Smile

now I am not sure who is right here?!?

after 52 query updates (just on forum model) whit select on tables that runs for forum posts, topics and structure I don't get any visible speed up, pages generating time on every page is almost the same...

of course, all 52 update query's don't loading at same page and time, but maybe on forum index 10-15 of them is calling altogether! I think that situation is same, I am of course ask users what they think so update will be shortly Smile

With only one table, you're looking at a difference of thousandths of a second per query (or less)... It's unlikely there will be a noticeable difference in what you see.

i agree

Theme © iAndrew 2016 - Forum software by © MyBB