Réf. : [freetds] RE: problem with fetching NULL values + type "bit"

Cedric Dumetz Cedric.Dumetz at eolas.fr
Tue May 22 11:49:51 EDT 2001


thanks it's worked !

In fact we found what the problem is :
our variable got the string value <NULL> (with the '>' and '<') so when we
write in HTML we saw nothing cause the navigator take that like an HTML
balise
--------------------
$temp = "X" . $row[COL1] . "X";
echo $temp;
----------------------
this write "XX" in navigator but "X<NULL>X" in HTML source code.


PS : maybe you know why freetds doesn't known the type 'bit' in sqlServer
and cause a server ERROR !!!!!!!

------------------------
$sql = "select COL_BIT from myTable";
$rs = mssql_query($sql) or die ("Erreur : $sql <BR>");
$row = mssql_fetch_array($rs);
echo  $row[COM_BIT];
--------------------------------

instead, I'm must do like this

------------------------
$sql = "select cast(COL_BIT as tinyint) COL_BIT from myTable";
$rs = mssql_query($sql) or die ("Erreur : $sql <BR>");
$row = mssql_fetch_array($rs);
echo  $row[COM_BIT];
--------------------------------






More information about the FreeTDS mailing list