Re: [PHP] Problem extending mysqli - "No database connected"



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/
.



Relevant Pages

  • Re: UNIQUE IDENTIFIER - SERVLETS/EJB
    ... private long lastSave; ... an extra system besides the database for data-related operations. ... your simple ID generator, and more if you've never done it before. ...
    (comp.lang.java.programmer)
  • Re: String vs. Collection
    ... database I am connecting, the program will "switch" Class to match the ... Public Sub Init(ByRef cls As CProjConfig) ... Private Function IDB_adoConn As ADO.Connection ... ... Private Sub IDB_Init ...
    (microsoft.public.vb.enterprise)
  • Re: String vs. Collection
    ... database I am connecting, the program will "switch" Class to match the ... Public Sub Init(ByRef cls As CProjConfig) ... Private Function IDB_adoConn As ADO.Connection ... ... Private Sub IDB_Init ...
    (microsoft.public.vb.enterprise)
  • Re: Private firm may track all email and calls
    ... The private sector will be asked to manage and run a communications ... database of all UK communications traffic into private hands would be ... security service operations since 2004 including the Soham and 21/7 ...
    (uk.legal)
  • Re: Database connection from PDA over cradle
    ... As a heads up when I try and hit the server with the name it can't find it ... Does it work if you use the ip address for the database instead of the ... Private myDS As New DataSet ... System.Data.SqlClient and in the connectionstring of your connection you ...
    (microsoft.public.pocketpc.developer)