but that forces me to implement a large interface of functions that I prefer to avoid...

the $dummy thing works... but I guess it is not "by the book".

I would like to understand what am I missing fom the concept....

Thanks.

JCG

Daniel Brown wrote:
On Jan 16, 2008 12:57 PM, julian <[EMAIL PROTECTED]> wrote:
Hi,

I am implementing this
[snip!]

    I'm heading out to lunch, so double-check this for errors, but I
rewrote your class.  You'll have to add your fetch handlers and such.

<?
class dbaccess{
  static $db = null;
  static $conn = null;
  static $query = null;
  static $othervar = 33;

  private function self(){
    dbaccess::$conn = new mysqli(HOST,DBNAME,PASS,USERNAME);
    if(mysqli_connect_errno()){
      return False;
    } else {
        return dbaccess::$conn;
    }
  }

  public function query($query){
        dbaccess::$query = mysqli_query(dbaccess::self(),$query);
        return dbaccess::$query;
  }

public static function GetDb(){
  if(dbaccess::$db==null){
  dbaccess::$db= new dbaccess();
  }
  return dbaccess::$db;

  }
}


$db=dbaccess::GetDb();
$db->query(......................); // Your query here.
?>


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

Reply via email to