Re: Undeclared function loading DB/mysql.php

From: Date: Mon, 13 Jan 2003 14:24:55 +0000
Subject: Re: Undeclared function loading DB/mysql.php
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3274@lists.php.net to get a copy of this message
On Mon, 2003-01-13 at 08:14, Martin Jansen wrote: > On Sun Jan 12, 2003 at 06:4612PM -0600, Stephen Torri wrote: > > I get this message when I have DB.php and DB/mysql.php listed in the php > > code as: > > > > include_once "DB.php"; > > include_once "DB/mysql.php"; > > You don't need to load DB/mysql.php manually when using > PEAR::DB. It will automatically be loaded by DB.php. > > > Error: > > > > Fatal error: Call to undefined function: raiseerror() in > > /usr/share/pear/DB/mysql.php on line 134. > > > > Grepping the files I found that the class PEAR provides this. Why do > > some classes "include_once" or "require_once" dependent classes (e.g. > > Class B uses a function in Class A so it does 'include_once "A.php") > > while others do not? > > As I already wrote above, DB/mysql.php should never be used > directly. Because of this there is no need for mysql.php to load > the files again which have already been loaded by DB.php. > > Anyways, I've commited a patch to CVS that fixes this > "problem" by loading PEAR.php in DB/Common.php. Thanks for the fix and the reply. Here is the latest result. I change the index.php file so that it only includes DB.php. Upon reloading the page I get: Fatal error: Undefined class name 'db_mysql' in /home/storri/.www-docs/index.php on line 14 Hopefully this will be fixed when the updated packages are available. Stephen -- Stephen Torri <storri@sbcglobal.net>

Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
« previous php.pear.general (#3274) next »