Re: Result in array
| From: | Torsten Roehr | Date: | Tue, 27 Apr 2004 16:49:30 +0000 |
| Subject: | Re: Result in array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184783@lists.php.net to get a copy of this message | ||
Remove the where part from your query to get all products. The result you're
getting from the query ($result) should will be an array. Do
print_r($result) to see its contents.
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...