#1211 [Bgs]: Site docs for Db:tableInfo error
| From: | danielc at analysisandsolutions dot com | Date: | Tue, 20 Apr 2004 19:58:26 +0000 |
| Subject: | #1211 [Bgs]: Site docs for Db:tableInfo error | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-3677@lists.php.net to get a copy of this message | ||
ID: 1211
Updated by: danielc@analysisandsolutions.com
Reported By: js at nexista dot com
Status: Bogus
Bug Type: Documentation
PHP Version: Irrelevant
Assigned To: danielc
New Comment:
Glad you sorted out what happened. Your question is unclear.
It seems that all you really need to do is adjust your include_path so
it looks in the desired directories for your version of PEAR.
include_path can be set in many ways. See
http://php.net/configuration_changes for more
info on that.
If you have any other questions, please use the pear-general mailing
list. http://pear.php.net/support.php
Previous Comments:
------------------------------------------------------------------------
[2004-04-20 15:51:42] js at nexista dot com
Okay. my bad. My code was using my distro's pear instead
of the files in my script - sorry to waste your time.
Isn't there a way to use my own DB/PEAR without having to
go and delete all the require_once...in all the files?
------------------------------------------------------------------------
[2004-04-20 15:50:11] danielc at analysisandsolutions dot com
Yes, I get both arrays.
From the way you're describing the version numbers, there is a very
good likelyhood that your PEAR DB installation, and perhaps PEAR
itself, are wacked out. Blow away your old installation and start
fresh: http://pear.php.net/manual/en/installation.php
If your averse to that, set up a test bed from CVS and run the test
suite, and our test script, using that. Instructions are found here:
http://cvs.php.net/co.php/pear/DB/doc/TESTERS
Perhaps you're not connecting to the database or the queries are
failing. After the connect statement, put this:
if (DB::isError($db)) {
die($db->getMessage());
}
$db->setErrorHandling(PEAR_ERROR_DIE);
------------------------------------------------------------------------
[2004-04-20 15:26:54] js at nexista dot com
I get 2 empty arrays. With older DB (v 1.1) I get an empty
array on first dump and correct output on second. To be
sure I went and redownloaded the latest DB (1.58) and
latest PEAR (1.80)
Here is my phpinfo() dump:
http://ravenheartcoffee.com/php.html
Do you get output on both array dumps?
Joshua
------------------------------------------------------------------------
[2004-04-20 09:40:08] danielc at analysisandsolutions dot com
The following example works for me:
<?php
$db =& DB::connect('mysql://root:@localhost/dbname');
$db->query('CREATE TABLE blah (a integer)');
$db->query('INSERT INTO blah VALUES (5)');
$res =& $db->query('SELECT a FROM blah');
print_r($db->tableInfo($res));
print_r($res->tableInfo());
$db->query('DROP TABLE blah');
?>
Please copy and paste it into a stand alone script. What happens?
------------------------------------------------------------------------
[2004-04-20 01:00:00] js at nexista dot com
Small correction in what I said. That code never worked
but in older version I used $res->tableInfo() as you've
probably figured out I meant.
Joshua
------------------------------------------------------------------------
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://pear.php.net/bugs/bug.php?id=1211
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=1211&edit=1