ID: 10369 Updated by: ahill Reported By: [EMAIL PROTECTED] Status: Closed Bug Type: ODBC related Operating system: PHP Version: 4.0.4pl1 Assigned To: Comments: Reproduced with the PHP script. Also reproduced without PHP, using both OpenLink and the Native SQLServer driver. This is a failure of the database layer to the SQLColAttribute (or SQLColAttributes) call. SQLColAttributes: In: hstmt = 0x008218D8, icol = 1, fDescType = SQL_COLUMN_TYPE=2, rgbDesc = 0x00154528, cbDescMax = 600, pcbDesc = 0x001552F0, pfDesc = 0x00155E30, Description Type = SQL_C_SLONG=-16 Return: SQL_SUCCESS=0 Out: *rgbDesc = <unmodified>, *pcbDesc = 4, *pfDesc = 4 TST1001: Buffer rgbDesc was not updated. Best regards, Andrew Previous Comments: --------------------------------------------------------------------------- [2001-05-04 15:15:52] [EMAIL PROTECTED] Firstly, please use --with-iodbc instead of --with-iodbc. Also, this is most likely not a PHP issue but a database specific issue, and will only occur in cases where the corresponding database CLI call doesn't work natively. Please test this with the latest OpenLink drivers and open a support case at http://www.openlinksw.com/support/suppindx.htm if the problem persists. --------------------------------------------------------------------------- [2001-04-17 20:12:15] [EMAIL PROTECTED] 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 --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=10369&edit=2 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]