|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-24 22:45 UTC] kalowsky@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 00:00:02 2025 UTC |
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>"; } ?>