Bug #13286 Updated: Freetds + iODBC problems retrivind numeric fields
| From: | kalowsky@php.net | Date: | Tue, 25 Jun 2002 02:45:20 +0000 |
| Subject: | Bug #13286 Updated: Freetds + iODBC problems retrivind numeric fields | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11992@lists.php.net to get a copy of this message | ||
ID: 13286
Updated by: kalowsky@php.net
Reported By: fernando@robynet.com.br
-Status: Open
+Status: Closed
Bug Type: ODBC related
Operating System: Linux Mandrake
PHP Version: 4.0.4pl1
New Comment:
The iODBC system works fine with your sample when connecting to the
Virtuoso and PostgreSQL-ODBC databases. So I'm guessing this has to do
with the Freetds interaction.
Two suggestions:
1) try a newer version of PHP and see if it continues.
2) if that doesn't fix, you might want to also open a bug with Openlink
Software in regards to this... as it sounds like a driver level issue
if it works with some and not others.
Previous Comments:
------------------------------------------------------------------------
[2001-09-13 12:19:33] fernando@robynet.com.br
I Have problems retrivind and printing fields type numeric and date.
Using iODBC to access SQL Server 7.0
My Configure Line:
./configure --prefix=/usr/local/matriz/php4
--with-apxs=/usr/local/matriz/apache/bin/apxs
--with-iodbc=/usr/local/matriz/iodbc --enable-track-vars
Script PHP:
<?php
putenv("LD_LIBRARY_PATH=/usr/local/freetds/lib/libtdsodbc.so");
putenv("ODBCINSTINI=/etc/odbcinst.ini");
putenv("ODBCINI=/etc/odbc.ini");
if ($con = odbc_pconnect("SQLSERVER","username","passwd")) { print
"Success!
<br>"; } else { print "Error connection <br>"; } // This line prints
"Success";
$sql = "SELECT * FROM contacts";
/* Contacts have 2 fields: Name (char) and Number (numeric) */
$prep = odbc_prepare($con,$sql);
if (odbc_execute($prep))
{
while (odbc_fetch_row($prep))
{
print odbc_result($prep,1); // Print correct name
print " - ";
print odbc_result($prep,2); // Print nothing, not return any error,
simply
prints ''
print "<br>\n";
}
}
else
{
print "Error executing query! <br>";
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=13286&edit=1