Can't display decimal from MS SQL 7.0. Need Help 911!!!

bao nguyen baonguyenx at yahoo.com
Tue Dec 12 15:14:36 EST 2000


Hi,

I was able to insert, delete, and query out from MSSQL7.0(SP2) using
PHP4.0.2, Apache1.3.9, FreeTDS 0.51 from Linux 6.1 . There is only one
problem displaying decimal. Example, TDSTable has the following fields

(int)        (dec)       (dec)       (dec)
RecordID     ProdWt      BoxWt       Price
93           12.50       5.67        18.00

<?php
$connection = mssql_connect("localhost", "admin", "xxx");
$db = mssql_select_db("test", $connection);

$sql = "SELECT * FROM TDSTable WHERE RecordID = 93";
$sql_result = mssql_query($sql);
	
while( $row = mssql_fetch_array($sql_result) )
{
echo ("Product Weight: $row[ProdWt]<br>");
echo ("Box Weight: $row[BoxWt]<br>");
echo ("Price: $row[Price]<br>");
}
?>
This is the result that I got.

Product Weight: 12
Box Weight: 5
Price: 1

What had I done wrong ? Is there any clue ???

Thanks,
Bn



More information about the FreeTDS mailing list