RE: [PHP] Need your help again.. Sorry...
| From: | John Holmes | Date: | Sun, 21 Jul 2002 01:39:26 +0000 |
| Subject: | RE: [PHP] Need your help again.. Sorry... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108685@lists.php.net to get a copy of this message | ||
Are the other lines being written correctly? How does it "not work?"
Are you sure there is anything in the $cart array?? If there isn't, the
while loop won't be executed. Put in a check to just make sure that it's
being executed.
---John Holmes...
> -----Original Message-----
> From: Wee Keat [mailto:weekeat@amorphosium.com]
> Sent: Saturday, July 20, 2002 9:25 PM
> To: PHP General
> Subject: [PHP] Need your help again.. Sorry...
>
> Hi all...
>
> Sorry for troubling you guys again... but I really do not know what
else I
> could do.
>
> Can you please tell me why this code fputs($write, "$productlist");
isn't
> printing correctly?
>
> I have already connected to db. Just this particular one didn't
work...
> dun understand..
>
>
> The Code:
>
>
> fputs($write, "Email: $email\n\nProduct Enquired:");
>
> while (list($key,$prod_id) = each($cart)) {
>
> $cart[$key] = $prod_id;
>
> $result = mysql_query("SELECT * FROM products WHERE prod_id
=
> '$prod_id' ORDER BY prod_brand ASC", $link_id);
>
> $query_data = mysql_fetch_array($result);
>
> $gst = 1.10;
>
> $rrp = 1.12;
>
> $price = $query_data["price_lq"] * $rrp * $gst;
>
> $productlist .= "\n\n".$query_data["prod_brand"]."
> ".$query_data["prod_desc"]." $".number_format($price, 2,
> '.', '');
>
> fputs($write, "$productlist");
>
> }
>
> fputs($write, "\n\n-----------------------------");
>
>
>
> Please help... thanks soooo much again.
>
>
>
> Yours,
> Wee Keat Chin
>
> ---------------------------------------------------
>
> "Man is only truly great when he acts from his passions."