Re: Undeclared function loading DB/mysql.php

From: Date: Mon, 13 Jan 2003 14:14:19 +0000
Subject: Re: Undeclared function loading DB/mysql.php
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3273@lists.php.net to get a copy of this message
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. -- - Martin Martin Jansen http://martinjansen.com/

« previous php.pear.general (#3273) next »