473,473 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Create 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("DB.php");

$dsn = "odbc://db2inst1:badpasswd@testdb";
$db = DB::connect($dsn);
echo $db->getMessage();
if(DB::isError($db))
echo "Connect failed!";
else
{
$res = $db->query("SELECT * 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 1344

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

Similar topics

0
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...
1
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...
0
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...
3
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:...
1
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...
1
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...
2
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)...
0
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...
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.