-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On September 12, 2002 01:55, Christian Ista wrote: > > $result = mysql_query(...); > > while( $t = mysql_fetch_row($result) ){ > > $array[] = $t; > > } > > No. I need a 2 dimensions arrays, each line of this array, is the result > of one row of the query and each cell of this row is a field from the > select.
Did you test the code? :) > Example, the query return 2 row and 3 fields for each row : > "Christian", "Ista", "Belgium" > "zak", "PhpNet", "Dontknowfrom" > > resulf of SELECT NAME, LASTNAME, COUNTRY FROM MyTable; The code snippet above combined with the above query would create an array of this structure: $array[0][0] = 'Christian'; $array[0][1] = 'Ista'; $array[0][2] = 'Belgium'; $array[1][0] = 'zak'; $array[1][1] = 'PhpNet'; $array[1][2] = 'Canada'; > I'd like to put that in an array and later because I use a session array. > > I'd like via a for loop access these data by > echo(MyArray[1][1]); result is "PhpNet" > echo(MyArray[0][2]); result is "Belgium" > echo(MyArray[1][0]); result is "zak" > > Is it clearer now ? Cheers! - --zak -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9gD/1b6QONwsK8bIRAmm7AJ41PUo2zVmFwN/vfvTr4j6Fze/NdwCbBPZm bWnEPyBj+bKQsnQ2bg9HZ7E= =q8vy -----END PGP SIGNATURE----- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php