ODBC queries return incorrect data types

From: Date: Thu, 07 Dec 2000 21:00:52 +0000
Subject: ODBC queries return incorrect data types
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29214@lists.php.net to get a copy of this message
I've installed PHP 4.0.3pl1 and ODBC-ODBC Bridge 1.0.0.23 on freeBSD / Apache 1.3.14 to connect to an MS SQL Server 2000 on Windows NT. All the numeric datatypes (integers, bit, etc) are returned as numeric(x,2) when I run queries. So an integer value of 1, or a "true" bit is returned as a "1.00" instead if 1. This is with PHPLIB using $dbvar->f("fieldname") ex: echo "This is an int equal to 1: ".$dbvar->f("integerfield"); will echo: This is an int equal to 1: 1.00 Any clue? I've been "fixing" this temporarily by typecasting everything to an (int) but this gets tedious and an oversight could be dangerous... Pascal Jolin

« previous php.general (#29214) next »