PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I have a derived class that extend mysqli, and I'm trying to initialize mysqli in my derived construct.
no succes.
i've to instanciate the mysqli object to get the connection !!, WHY ?
NOT working.
class mySQL extends mySQLi
public $_mySQLi;
function __construct( $db ){
$this->_mySQLi= new mysqli("127.0.0.1", "login", "pwd", $db);
}
end class
$obj = new mySQL();
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by olog-hai on Tue Jun 05, 2007 11:51 am, edited 1 time in total.
Using the class name as the constructor is the PHP4 style. PHP5 added __construct(). I believe that either now work in PHP5. Probably mysqli only supports the PHP4 style.