[PHP-DEV] Bug #13286: Freetds + iODBC problems retrivind numeric fields From: fernando <email protected>
Date: 09/13/01

From: fernando <email protected>
Operating system: Linux Mandrake
PHP version: 4.0.4pl1
PHP Bug Type: ODBC related
Bug description: Freetds + iODBC problems retrivind numeric fields

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 bug report at: http://bugs.php.net/?id=13286&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>