Esselebroopsy
New Member
I been looking at some database (MySQL) wrapper classes, A lot of them work like this,
1) Run the sql query
2) while fetching associative mysql array, they cyle through the results and add them to there own array
3) then you would run the class like this below and cycle through it's array\[code\]<?php $database = new Database();$result = $database->query('SELECT * FROM user;');foreach ($result as $user){ echo $user->username;}?>\[/code\]So my question here, is this not good on a high traffic type site? I ask because as far as I can tell, mysql is returning an array which eats memory, then you are building a new array from that array and then cycleing through the new array. Is this not good or pretty much normal?
1) Run the sql query
2) while fetching associative mysql array, they cyle through the results and add them to there own array
3) then you would run the class like this below and cycle through it's array\[code\]<?php $database = new Database();$result = $database->query('SELECT * FROM user;');foreach ($result as $user){ echo $user->username;}?>\[/code\]So my question here, is this not good on a high traffic type site? I ask because as far as I can tell, mysql is returning an array which eats memory, then you are building a new array from that array and then cycleing through the new array. Is this not good or pretty much normal?