[DB] [DB_DataObject] dataobject empty (DB Error: no database selected)
| From: | Stijn de Reede | Date: | Mon, 28 Feb 2005 09:36:10 +0000 |
| Subject: | [DB] [DB_DataObject] dataobject empty (DB Error: no database selected) | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17721@lists.php.net to get a copy of this message | ||
Hi all,
I've got a very strange problem. I'm moving my CMS I wrote from my own dev pc to a shared hosting account.
Since I don't have the permission to install new PEAR package there, I put it there manually, with go-pear.php. The PEAR php files are in /home/rcb/pear/PEAR, and the DataObjects files are in /home/rcb/DataObjects/DataObjects. I had to copy them there manually after creating them on a different host, since createTables.php had the same problem (DB Error: no database selected).
Please look at http://www.racketcentrum-bilthoven.nl/test.phps for the test example.
As I said, the problem is very weird.
After calling for example the selectAdd() method once, the second time it fails, because the object doesn't exist anymore.
After calling the get() method, the object only exists for 2 lines, when I print_r it.
With DB_DataObject::debugLevel(1) I saw in a different file (http://www.racketcentrum-bilthoven.nl/site/php/content_text.php?action=show&id=1) the "DB Error: no database selected" error. When I debugged this, I found out that instead of storing a resource in the connection variable, it stored a "1". mysql.php failed on this in the simpleQuery() method, returning the "DB Error: no database selected".
Some version info:
PEAR:
Installed packages:
===================
Package Version State Archive_Tar 1.2 stable Console_Getopt 1.2 stable DB 1.6.8 stable DB_DataObject 1.7.2 stable Date 1.4.3 stable HTML_BBCodeParser 1.1 stableHTML_Template_Xipe 1.7.6 stable
Log 1.8.7 stable Mail 1.1.4 stable Net_SMTP 1.2.6 stable Net_Socket 1.0.6 stable PEAR 1.3.5 stable Tree 0.2.4 beta XML_Parser 1.2.5 stable XML_RPC 1.2.0 stablePHP: 4.3.10 (Server API CGI) MySQL: Client API version 3.23.58 I hope someone can help me, Stijn