Re: Problem extending mysqli - "No database connected"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux