[prev in list] [next in list] [prev in thread] [next in thread]
List: pear-dev
Subject: [PEAR-DEV] Re: [DB] [DB_DataObject] dataobject empty (DB Error: no database
From: 212.238.218.88
Date: 2005-02-28 16:34:50
Message-ID: 20050228163443.35171.qmail () lists ! php ! net
[Download RAW message or body]
Ok, even stranger, I've got it working now. It seems the autoloader
(factory method) had some problems.
I solved it by manually requiring all the DataObjects, and by using
$content_text = &DB_DataObject::factory('Content_text');
instead of
$content_text = DB_DataObject::factory('Content_text');
I've got no clue why this needs to be done, but it works...
Can anyone shed some light on this?
Stijn
Stijn de Reede wrote:
> 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 stable
> HTML_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 stable
>
> PHP: 4.3.10 (Server API CGI)
> MySQL: Client API version 3.23.58
>
>
>
> I hope someone can help me,
>
> Stijn
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic