> > $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. > > 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; > > 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 ? > > Thanks, > > Christian >
That's exactly what this will do. mysql_fetch_row() returns an array. Appending that to another array and you get back an array of arrays (which is the same as a 2D array) Try it and see... Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php