#15331 [Com]: odbc_fetch_array gives a "Call to undefined function"

From: Date: Mon, 12 May 2003 23:55:49 +0000
Subject: #15331 [Com]: odbc_fetch_array gives a "Call to undefined function"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39502@lists.php.net to get a copy of this message
ID: 15331 Comment by: prophet007 at hotmail dot com Reported By: tcurdt at dff dot st Status: No Feedback Bug Type: ODBC related Operating System: Linux PHP Version: 4.2.0 New Comment: This is a huge pain when you're trying to develop using MS SQL 2000... I've developed with MySQL and my employer wants to use MS SQL and now a bunch of code has to be rewritten because there isn't an equivalent way to run mysql_fetch_assoc... the fact that PHP.net says it should work in version 4.3.1 and it doesn't is even more aggrivating... just for the record, I'm running MS SQL Server 2000 on W2K with PHP version 4.3.1... Previous Comments: ------------------------------------------------------------------------ [2003-04-13 20:00:24] eng at anrdaemon dot mtu-net dot ru I found workaround for this function somewhere in internet, but this workaround NOT completely solve the problem. For me, next code may be most usable (PHP 4.3): function odbc_fetch_array($result, $rownumber=-1) { if ($rownumber < 0) { odbc_fetch_into($result, $rs); }else odbc_fetch_into($result, $rs, $rownumber); foreach ($rs as $key => $value) $rs_assoc[odbc_field_name($result, $key+1)] = $value; if (isset($rs_assoc)) return $rs_assoc; else return false; }; while ($w2ta = odbc_fetch_array($w2rc)) $w2fd[$i++] = $w2ta; ------------------------------------------------------------------------ [2002-08-23 07:47:51] brunofr at ioda dot net With php 4.2.2 Win32 binary from php.net unable to use the function ( undefine function call ) ------------------------------------------------------------------------ [2002-05-21 23:42:24] kalowsky@php.net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2002-04-24 11:12:23] Marcus dot Karlsson at usa dot net It's possible to get odbc_fetch_array() and odbc_fetch_object() to work without DBMAKER. This is achieved by removing a few #ifdef's in the code: php_odbc.h - line 216 => //#ifdef HAVE_DBMAKER php_odbc.h - line 219 => //#endif php_odbc.c - line 87 => //#ifdef HAVE_DBMAKER php_odbc.c - line 90 => //#endif php_odbc.c - line 87 => //#ifdef HAVE_DBMAKER php_odbc.c - line 90 => //#endif php_odbc.c - line 1229 => //#ifdef HAVE_DBMAKER php_odbc.c - line 1280 => //#endif I've tested this towards MySQL using MyODBC drivers and it seems to be working just fine. ------------------------------------------------------------------------ [2002-04-24 04:34:28] mfischer@php.net odbc_fetch_array() is only available if compiled with --with-dbmaker support (note: not tested but that's what I gathered from reading the sources). Can you try this please ? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/15331 -- Edit this bug report at http://bugs.php.net/?id=15331&edit=1

« previous php.bugs (#39502) next »