I'm trying to create an object derived from the MySQLi object to easier handle database connections for my application. The thing is that I do not know how I shall be able to initalize the connection and keep it contained in the object. Let me illustrate what I mean:

   class db extend mysqli {
      //Overriding connect()
      public function connect($info){
          //This is where I get lost
          //I Want to be able to connect
          //without creating a new object
          //with mysqli_init()

          $mysqli = mysqli_init();

          //I want the connection to be
          //"attached" to $this object so that
          //the code would look something like...


          //But this I cannot do because of the
          //object that mysqli_init() returns which is
          //needed for mysqli_real_connect()

Any Ideas?

Thank you! I checked the manual earlier but couldn't find what I was looking for. Thanks!