Skip to Content.
Sympa Menu

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

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Cedric Dumetz" <Cedric.Dumetz AT eolas.fr>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Réf. : [freetds] RE: problem with fetching NULL values + type "bit"
  • Date: Tue, 22 May 2001 17:49:51 +0200


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];
--------------------------------






  • Réf. : [freetds] RE: problem with fetching NULL values + type "bit", Cedric Dumetz, 05/22/2001

Archive powered by MHonArc 2.6.24.

Top of Page