Re: Result in array
| From: | Torsten Roehr | Date: | Tue, 27 Apr 2004 16:56:58 +0000 |
| Subject: | Re: Result in array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184784@lists.php.net to get a copy of this message | ||
You can loop through the mysql result set with:
while(list($column1, $column2, $column3) = mysql_fetch_row($result)) {
// output the values
echo $column1;
echo $column2;
echo $column3;
}
Regards, Torsten
>>>
"Phpu" <phpu@go.ro> wrote in message
news:000e01c42c72$fcb6d170$5600a8c0@fannehh...
I want to interogate the database and the results to be placed into array.
For now i have:
$query = "SELECT product_id, brand_name, model_name FROM products WHERE
product_id='$product_id'";
$result = mysql_query($query) or die("error in query - $query -
".mysql_error());
$results = mysql_num_rows($result);
i want all athe results to be placed in an array named "models" and then i
want to print all the results.
How can i do that.
PS. The results must be place in an array.
Regards...