Re: Problem extending mysqli - "No database connected"

From: Date: Fri, 29 Jun 2007 18:17:30 +0000
Subject: Re: Problem extending mysqli - "No database connected"
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-257981@lists.php.net to get a copy of this message
Please always include the list when replying. Lee PHP wrote:
Yup, that was it - thanks! Coming from a Java OO background, I find it frustrating that PHP doesn't warn me about stuff like that. Oh well, I guess I'll know next time.
End the frustration, turn notices on. This reminds me of a saying about workmen and their tools. -Stut -- http://stut.net/ > On 6/29/07, Stut <stuttle@gmail.com> wrote: >> Lee PHP wrote: >> > I have a class that extends msyqli that AFAIK can connect to the >> > database, but gives me an error when I try and query it. Here's my >> > class: >> > >> > -- BEGIN DATABASE CLASS -- >> > require_once('Configuration.php'); >> > require_once('RSFSException.php'); >> > >> > class Database extends mysqli { >> > >> > private $strUrl = "DEV"; >> > private $strUser; >> > private $strPass; >> > private $strHost; >> > private $intPort; >> > private $strName; >> > >> > private static $INSTANCE; >> > private static $CONFIG; >> > >> > private function __construct() { >> > $this->CONFIG = Configuration::getInstance(); >> > $this->establishConnectionSettings(); >> > $this->connect($this->getHost(), $this->getUser(), >> > $this->getPass(), $this->getName); >> >> I'm assuming $this->getName should have () on the end. >> >> This is probably why it's failing. It's connecting ok, but not selecting >> a database. >> >> -Stut >> >> -- >> http://stut.net/ >>

« previous php.general (#257981) next »