php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21247 odbc_fetch_object not defined
Submitted: 2002-12-28 10:05 UTC Modified: 2003-01-19 16:11 UTC
From: charlesk at netgaintechnology dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.3.0 OS: Windows 2000 Server
Private report: No CVE-ID: None
 [2002-12-28 10:05 UTC] charlesk at netgaintechnology dot com
I am getting this error
PHP Fatal error:  Call to undefined function:  odbc_fetch_object()

The documentation says it is available in (PHP 4 >= 4.0.2)

This is the line of code
   $row = odbc_fetch_object($sql_result,$i);

Was this missed?

Charles Killmer

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-28 11:01 UTC] kalowsky@php.net
It's not really a bug.  The problem is odbc_fetch_object is (at this time) only supported through the DBMAKER database.  I have insufficent time and resources to test against all DBs and as such it is #defined out.    

Theoretically it should work with your Win2k Server, and you can test this by removing the #defines from the odbc_fetch_object call.  If it works, I'd be more than happy to integrate the change into further releases.  As it stands though I have no firm proof that it does. 


 [2002-12-28 15:06 UTC] charlesk at netgaintechnology dot com
I would love to test it but I dont have the time to spend compiling php.  I have never compiled php.  I am an avid programmer and am competant in c, and c++.  If you have a quick guide to compiling php I would love to try it.  

Which file?
Which compiler is preferred? I have Borland Command line 5.5


Thanks
Charles Killmer
BTW the odbc dsn is looking at an access database.
 [2002-12-29 09:26 UTC] kalowsky@php.net
The main page of PHP has a nice HOWTO on building PHP for windows.


What you'll need to edit are all in ext/odbc:

php_odbc.h:
remove lines 57 and 60.

php_odbc.c
remove lines 87 and 90
remove lines 1354 and 1511


If you can get it to work I'll move the support to MSSQL now too.
 [2003-01-16 10:28 UTC] kalowsky@php.net
Changing from bogus to not bogus, as I've just enabled fetch_object for windows.  Try a snapshot and tell me if it works for you.
 [2003-01-16 21:26 UTC] charlesk at netgaintechnology dot com
I think I got to the snapshots to late.  I downloaded the 4.3.x-dev snapshot and it said odbc_fetch_object is undefined.  I also tried the 5.0.x-dev but it would only return error 500. 

Let me know if you can re-enable it and I will make sure to download it right away.

Thanks
Charles Killmer
 [2003-01-17 00:56 UTC] kalowsky@php.net
It's still enabled.  I haven't disabled it yet, and probably won't until I hear negatory or postive from you.  It should be in the PHP5 branch, not the 4.3 branches.  Any snapshot after this posting should have it.  

I might need to try and get my windows boxen working again to test this if you're getting an error 500 (no idea what that menas).  If you can share the complete error, and the sample script you're using it would help a lot :)
 [2003-01-19 08:04 UTC] charlesk at netgaintechnology dot com
It works.  :)  If you need to know any specifics about my computer, Windows XP Pro SP 1, Apache 2.0.43, The ODBC driver for Access databases that came with Windows, I havent installed Access on this computer.  If you need anything else just let me know.

Thanks
Charles
 [2003-01-19 16:11 UTC] kalowsky@php.net
Marking as closed then.  You may wish to add a comment to the odbc_fetch_object documentation page with regards to how you made this work on Windows, and a sample script for others to try :)  I'm sure they will appriciate it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 30 00:01:29 2024 UTC