Re: Array N-Dimensial RELOADED

From: Date: Mon, 08 Mar 2004 07:30:37 +0000
Subject: Re: Array N-Dimensial RELOADED
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-46325@lists.php.net to get a copy of this message
Pues haces algo sencillo: <code> $consutla = mysql_query($SQL, $conexion) or die(mysql_error()); // $SQL seria la consulta y $conexion el resource id de mysql_connect() while($datos = mysql_fetch_array($consulta)) { $matriz[$datos['id']][$datos['grupo']][$datos['data']] = $datos['valor']; } </code> ----- Original Message ----- From: "emanuel quintana" <emanuel_quintana_cv@hotmail.com> To: <php-es@lists.php.net> Sent: Friday, March 05, 2004 2:23 PM Subject: [PHP-ES] Array N-Dimensial RELOADED > Perdon gente, pero me confundi, los indices del array no tienen que ser los > nombre de los campos, sino el valor de los mismos. > |id| |grupo| |data| | valor | > 1 1 1 4 > 2 1 0 1 > 2 2 1 5 > > $array["1"]["1"]["1"] tiene que tener el valor 4 > $array["2"]["1"]["0"] tiene que tener el valor 1 > $array ["2"]["2"]["1"] tiene que tener el valor 5 > > Asi es como tiene que guardar los datos el array, pero no se como hacerlo :( > Muchas gracias de nuevo. > > _________________________________________________________________ > MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/ > > -- > PHP Spanish Localization Talk Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general.es (#46325) next »