Re: Result in array
| From: | Matt Matijevich | Date: | Tue, 27 Apr 2004 17:09:44 +0000 |
| Subject: | Re: Result in array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-184789@lists.php.net to get a copy of this message | ||
[snip]
$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);
[/snip]
http://www.php.net/manual/en/ref.mysql.php
you could try this
$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());
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$models[] = $line;d
}