hello,
i am sensing some money matters here. what i can suggest is store plain float
numbers in mysql and just format the output on the screen. this can be done
using the following:
$number = 1234.56;
echo money_format('%i', $number) . "\n";
// USD 1,234.56
or sprintf function or printf
hope to help
*** credits: php.net manual
~kray | 418871
learn the rules so you know how to break them properly -unknown
----- Original Message ----
From: Brian E Boothe <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, 6 November, 2006 7:23:43 AM
Subject: [php_mysql] Numbers display in mysql
When I enter a number in a field like 123,000 it stores it as 123,000
but it doesn¢t see the comma when I display it how do I display my numbers
with a comma in mysql ,,
Here is what I have to display the numbers in an Inc File,,
----------(Code)-----------------
<?
/* Select Statement for grabbing total sums of All
Bids */
$link = mysql_connect("localhost","root","goobers") or
die(mysql_error());
mysql_select_db("idata", $link);
$sql1 = "SELECT SUM(Bidamount) as btstotal7 FROM workorders ";
$result = mysql_query($sql1, $link) or die(mysql_error());
while ($row =
mysql_fetch_assoc($result)) {
extract($row);
}
echo '<h9><font color="#00FF00">' . $btstotal7 . '</h9>';
mysql_free_result($result) or die(mysql_error());
mysql_close($link) or die(mysql_error());
?>
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.27/517 - Release Date: 11/3/2006
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.28/518 - Release Date: 11/4/2006
[Non-text portions of this message have been removed]
The php_mysql group is dedicated to learn more about the PHP/MySQL web database
possibilities through group learning.
Yahoo! Groups Links
Send instant messages to your online friends http://uk.messenger.yahoo.com
[Non-text portions of this message have been removed]
The php_mysql group is dedicated to learn more about the PHP/MySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/php_mysql/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/