this line:
while ($row = mysql_fetch_array($result1))
is already storing the values of each result row in an array.
The data is being overwritten on each loop, however. If you want to keep it for later use, instead of doing
while ($row = mysql_fetch_array($result1))
{
echo "<tr><td>".$row['mydata']."</td></tr>";
}
assign each row its own (unique) array:
while ($row = mysql_fetch_array($result1))
{
echo "<tr><td>".$row['mydata']."</td></tr>";
$savedRows[] = $row;
}
When you're done with the loop, the first row will be in [font=monospace]$savedRows[0][/font] (i.e., [font=monospace]$savedRows[0]['mydata'][/font], etc.), the second will be in [font=monospace]$savedRows[1][/font], and so forth.