Try this:
PHP Code:
$rows = array();
while($row = mysql_fetch_array($result))
{
array_push($rows,$row);
}
Basically combines every iteration through your resultset into one big array $rows:
Code:
Array
[0] => Array
[ID] => 1
[Name] => Product1
[Description] => Product 1's description
[Price] => $4.95
[1] => Array
[ID] => 2
[Name] => Product 2
[Description] => Product 2 is nice too
[Price] = $99.94
Then, if you want to iterate through the array, you can do this:
PHP Code:
for($i=0;$i<count($rows);$i++)
{
echo 'Product ID: '.$rows[$i]['ID'].'<br />';
echo 'Product Name: '.$rows[$i]['Name'].'<br />';
// etc, etc, etc
}
Make sense?
Bookmarks