Cita:
Iniciado por Pleniluni0 aqui te dejo una funcion:
Código PHP:
function db_array($result)
{
$res_array = array();
for ($count=0; $row = @mysql_fetch_array($result); $count++)
$res_array[$count] = $row;
return $res_array;
}
Espero que te sirva.
La función que planteas . .es lo mismo que :
while($fila = mysql_fetch_assoc($result)) {
$filas[] = $fila;
}
Si lo quieres ver como función:
Código PHP:
function db_array(
global $result;
$filas=array();
while($fila = mysql_fetch_assoc($result)) {
$filas[] = $fila;
}
return $filas;
}
Un saludo,