12 May
2006
12 May
'06
7:01 p.m.
Adrian Rossouw wrote:
The only place I could see something like this being useful is everywhere we do :
$result = db_query('something'); while ($data = db_fetch_array($result) { $return[$data['some_key']] = $data; }
AND NOTHING ELSE.
Even then, chances are you have some kind of logic done, even in this simple of loop (for example, what is 'some_key'? the node ID? the user ID? the free tagging term?). A 'get all the db stuff into an array' function just means instead of doing: while ($data = db_fetch_array($result) { ... } you're doing: foreach ($data as $key => $value) { ... } Same difference, except you end up looping twice. :P -Angie