I am developing a web interface against an existing MS SQL (2000) database.
When reading from integer fields (int (4)), the data is converted (formatted) into something that looks like a currency-formatted string.
Code extract:
$conn=odbc_connect( $SERVER, $USER, $PW);
$query1 = "SELECT id, persid FROM call_req";
$rs=odbc_exec($conn,$query1);
while ( $row = odbc_fetch_row($rs) )
{
print odbc_result($rs,1) . " - ";
print odbc_result($rs,2) . "<br>";
}
Results in (example):
400 800,00 - pcat:400800
400 801,00 - pcat:400801
...
id contains int(4) data, containing the numbers 400800 and 400801 for these two records, while persid is a varchar with "pcat:" + the same numbers added.
I am using Apache 2.0.58 and PHP 5.1.4 on Windwos XP against a MS 2003 Server with MS SQL 2000 installed.
Any suggestions how to get the numbers out with no "formatting"?
Btw, I also tried to add a WHERE statement:
"WHERE id=400800", but it didn't validate (ie give any rows as a result) through PHP, while the same SQL statement works fine in SQL Enterprise Manager.
Thorfinn (aka Bakerville)