|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-05-04 15:15 UTC] ahill@php.net
[2001-05-07 15:26 UTC] ahill@php.net
[2004-07-08 17:26 UTC] jfleost at intertek dot fr
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
This script reproduces the problem: <HTML> <HEAD> <TITLE>Test odbc_field_type</TITLE> </HEAD> <BODY bgcolor="#000000" text="#CCCCCC" link="#33CCFF" vlink="#996699" alink="#FF FFFF" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0"> <?php putenv("LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib"); putenv("LIBPATH=/usr/local/openlink/odbcsdk/lib:$LIBPATH"); putenv("SHLIB_PATH=/usr/local/openlink/odbcsdk/lib:$SHLIB_PATH"); putenv("UDBCINI=/usr/local/openlink/bin/odbc.ini"); putenv("ODBCINSTINI=/usr/local/openlink/bin/odbcinst.ini"); putenv("ODBCINI=/usr/local/openlink/bin/odbc.ini"); $dsn="DSN=Arbant"; $user="dba"; $password="sql"; $sql='Select cod_emp, cod_amb, den from loguec'; if(($conn_id=odbc_connect("$dsn","",""))){ if(($result=odbc_prepare($conn_id,$sql))){ @odbc_execute($result); if(!empty($result)){ $cols_count=odbc_num_fields($result); $ind=1; while($ind<=$cols_count){ $cols_name[$ind]=odbc_field_name($result,$ind); $cols_types[$ind]=odbc_field_type($result,$ind); $ind++; } echo "<H1>Results</H1>"; echo "<B>The Query is: $sql<B>\n"; echo '<TABLE align="center" border="1" bordercolor="green" cellpadding=" 2" cellspacing="0">'; $ind=1; echo "<tr><td><b>Names</b></td><td><b>Types</b></td></tr>"; while($ind<=$cols_count){ echo "<tr>"; echo "<td>" . $cols_name[$ind] . "</td>\n"; echo "<td>" . $cols_types[$ind] . "</td>\n"; echo "</tr>"; $ind++; } odbc_free_result($result); }else{ echo "Cannot execute query"; } }else{ echo "Cannot prepare query"; } } ?> </BODY></HTML> I compiled PHP standard, I simply run ./configure with openlink option , run make and make install. I can retrieve column name information and also data but I can't retrieve the column SQL Type. I asked Openlink and they said that is a PHP issue. I'm using Openlink Multi-tier Driver for accessing a MS SQL Server 7 Database on a Windows NT box from PHP scripts running on the Apache Web Server on a Linux Box OpenLink Version 4 PHP Version 4.0.4pl1 Linix SuSE 6.1 Kernel Version 2.2.7 Apache Version 1.3 PHP is running as a Loadable Apache Module