473,811 Members | 3,256 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP5RC2 and PEAR DB Problem

With PHP5RC2, DB::connect() is not returning the correct type of object.

#!/usr/local/bin/php
<?php
require_once("D B.php");

$dsn = "odbc://db2inst1:badpas swd@testdb";
$db = DB::connect($ds n);
echo $db->getMessage() ;
if(DB::isError( $db))
echo "Connect failed!";
else
{
$res = $db->query("SELEC T * FROM test_tbl");
while($row = $res->fetchRow())
echo $row[0] . "\n";
$db->disconnect() ;
}
?>

The password in the DSN is wrong and DB2 reports the error, however
DB::connect() still returns an object of type DB_odbc. I've traced
connect() in DB/odbc.php and confirmed that it recognized that
odbc_connect() failed and goes into that code path and creates a DB_error
object and I've even printed out the type of the object inside the function
before it returns it, but in the caller (my test script above), the reported
type is DB_odbc and so the if statement is false and then it tried to run
the query, but then I get a series of odbc_*() errors because there's no
valid resource for those functions to operate on. Has anyone been able to
use PEAR DB, specifically the ODBC driver, with PHP5RC2? The code above
works on another system, as expected, with PHP 4.3.6.

Thanks,

Derek
Jul 17 '05 #1
0 1365

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4409
by: Arne Kösling | last post by:
Hi ! I am new to Web Services. Therefore I ve set up a PHP Installation on Windows (PHP 4.3.2 and Apache 1.3.29). I have tested PHP alone and then installed PEAR. Now I am stuck there (Before that, I had many problems with the PHP-dlls) I've set up several SOAP Testscripts that I found on WebSites and in PHP-Books to get a PHP Client and a PHP Server communicate over Web Services (using PEAR::SOAP).
1
4007
by: Louis Aslett | last post by:
Hi, I am extremely stuck trying to port a PHP app from one server to another while making use of the PEAR Mail_mimeDecode package. We have just upgraded from RedHat 7.x to RedHat Enterprise Linux ES Basic v3 because of the end-of-life statement from RedHat. Basically, this means a change from Apache 1.3 to 2 and PHP 4.1.2 to 4.3.2. After initial problems getting Mail_mimeDecode to return any attachments to emails I downloaded and...
0
1529
by: Robert | last post by:
Iam running a server and PEAR is compiled with PHP. Before some days I have upgraded PHP from 4.3.4 to 4.3.7 using Apache update from WHM (cPanel). This went well but after that one client contacted me to tell me that he have problems with showing some variables. The thing is that he told me that he is using his own PEAR installation in his web hosting account ! This is part of the code which had a problem: $ID_rubrike =$row; //THIS...
3
2014
by: Jan Holland | last post by:
I am trying to install pear on a shared server/host following the instructions from: <http://uk.builder.com/architecture/web/0,39026570,20283197,00.htm> So I made a subdir on my site like: http://www.urlname.urlextension/pear/ to install the pear into by running go-pear.php fromthat subdir "pear"
1
1917
by: Greg | last post by:
I am trying to set up a local verion of Pear in my shared account, which my host said I can do. I have SSH access, and I followed all the instructions in the Pear Manual for setting up a local copy on a shared host. Everything seems to have gone fine, the directory structure is set up in my home directory in a folder called pear, and when i run config-show everything points to this directory. I then created a ..htaccess file to include...
1
2779
by: James | last post by:
Hey everyone, I have a really obscure but impassable problem with a reasonably simple piece of php/PEAR DB/MySQL code When calling several stored procs the first call succeeds, but subsequent calls fail no matter which SP is called first it always works, and the rest fail... with: >>>
2
5782
by: Alan Prescott | last post by:
I'm running SuSE Linux 9.3, fully up to date running # pear install db responds with ... downloading DB-1.7.6.tgz ... Starting to download DB-1.7.6.tgz (124,807 bytes) .............................done: 124,807 bytes requires package `PEAR' >= 1.0b1 DB: Dependencies failed Googling around this ng I found someone with a similar problem who solved it
0
1439
by: metin | last post by:
When I want to install php after the commands ../configure --with-apxs2=/www/bin/apxs --with-mysql and make without any error, when i type make install i have the following error: Installing PEAR environment: /usr/local/lib/php/ Archive_Tar - already installed: 1.3.1 Console_Getopt - already installed: 1.2 Fatal error: Call to undefined method PEAR_Registry::packageinfo() in
0
1239
by: mchristopher | last post by:
I'm having trouble compiling DOM XML support into PHP 4.4.2 on CentOS 4.3. Everytime I attempt to compile, it spits back this: .... chmod 755 /usr/lib/apache/libphp4.so Installing PHP CLI binary: /usr/local/bin/ Installing PHP CLI man page: /usr/local/man/man1/ Installing PEAR environment: /usr/local/lib/php/ Archive_Tar - already installed: 1.3.1
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.