You could try something like this:
//..... connection code
$rs = @("SELECT field1,field2,field3 FROM my_table");
while ($row = @mysql_fetch_array($rs)) {
$result[] = $row;
}
This will create a 2-dimensional array containing the entire result set. To access field2 in the 4th result row you'd use:
$result[3]["field2"]
However, this method does have some performance issues. It introduces an additional loop to the script which must iterate as many times as there are rows retrieved from the database. It also must allocate additional server memory for the creation of the $result variable. The more rows in your result set, obviously the bigger the performance impact will be.
HTH.
geoff