[PHP]OOP question

Status
Not open for further replies.

Adil

DevBest CEO
May 28, 2011
1,276
714
Quick question - is it better to use:
PHP:
class SQLi extends mysqli{
 
private $isConnected = false;
public function __construct(){
global $_CONF;
$link = parent::__construct($_CONF['mysql']['host'],$_CONF['mysql']['user'],$_CONF['mysql']['password'],$_CONF['mysql']['db']);
$isConnected = true;
}
}

Or is it better to use:
PHP:
class SQLi{
public function __construct(){
global $_CONF;
$link =new mysqli($_CONF['mysql']['host'],$_CONF['mysql']['user'],$_CONF['mysql']['password'],$_CONF['mysql']['db']);
}}
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
Good question, but personally I don't think it would matter. MySQLi is already in OOP format and is also available in procedural style so why bother writing a new OOP library for it?
 
Status
Not open for further replies.

Users who are viewing this thread

Top