delz wrote:
> Hi All,
>
> How do I make calculations in php or mysql if the value has a comma like
> 2,000 + 32,000 = 34,000. I have a problem
> calculating if one of my values has a comma. It doesn't display the right
> output. I'll appreciate anyone who can
> help me with this.
>
> Thanks.
orporation
> Tel. No. 858-
> Mobile No. (63) (919-xxx)
>
> -Original Message-
> From: delz [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, April 18, 2002 1:50 PM
> To: [EMAIL PROTECTED]
> Subject:Re: Math Comp
02 1:50 PM
To: [EMAIL PROTECTED]
Subject: Re: Math Computations
Hi All,
How do I make calculations in php or mysql if the value has a comma
like
2,000 + 32,000 = 34,000. I have a problem
calculating if one of my values has a comma.
al Message -
From: "Adam Alkins" <[EMAIL PROTECTED]>
To: "delz" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, April 11, 2002 5:44 PM
Subject: Re: Math Computations
> Something like
>
>
> $db = mysql_connect("localho
AIL PROTECTED]>
Sent: Thursday, April 11, 2002 5:44 PM
Subject: Re: Math Computations
> Something like
>
>
> $db = mysql_connect("localhost","database_user","password");
> mysql_select_db (database_name);
>
> $query = "SELECT * FROM tabl
Something like
";
while ($row = mysql_fetch_row($result)){
$subtotal=$row[0]*$row[2];
$total+=$subtotal;
echo "$row[0] | $row[1] | $row[2] | $subtotal";
$comptotal+=$row[0];}
}
echo "$comptotal $total";
?>
Obviously format it into a table would make sense, e.t.c.
Adam
- Or