Return to Snippet

Revision: 1462
at October 9, 2006 11:49 by sorehead


Updated Code
<?php
/*
mysql_fetch_all

Absurdly simple but utilitarian function returns a numeric array of associative arrays containing an entire result set.
*/
function mysql_fetch_all($result) {
    $all = array();
    while ($all[] = mysql_fetch_assoc($result)) {}
    return $all;
}
?>

Revision: 1461
at October 9, 2006 11:49 by sorehead


Initial Code
<?php
/*
mysql_fetch_all

Absurdly simple but utilitarian function returns a numeric array of associative arrays containing an entire result set.
*/
function mysql_fetch_all($result) {
    $all = array();
    while ($all[] = mysql_fetch_assoc($result)) {}
    return $all;
}
?>

Initial URL

                                

Initial Description
Simple but utilitarian function returns a numeric array of associative arrays containing an entire result set.

Initial Title
Mysql Fetch All

Initial Tags
mysql

Initial Language
PHP