Not that I am a php expert.. but it doesnt look like you ever assign
products to anything.

Shouldnt you be doing something like $products["$prod_id"] =
$row["prod_id"]

Also.. if you have more than one rows.. it would overwrite the array. Do
you want a 2-d array?

-Tanya


On Mon, 12 Mar 2001, [iso-8859-1] Marco Aurélio wrote:

> Hello!!!
> 
> Please, assume I have the following mysql query:
> 
> function get_products() {
> 
> $result = mysql_query("select * from products");
>         while ($row = mysql_fetch_array($result)) {
>                  $prod_id = $row["prod_id"];
>                  $prod_name = $row["prod_name"'];
>                  $prod_price = $row["prod_price"];
>         }
> return $products;
> }
> 
> The question:
> 
> Ok, my $products variable will be an array with all products ???
> 
> 
> Regards,
> 
> marcoBR
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to