本文整理汇总了PHP中Mysql::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Mysql::__construct方法的具体用法?PHP Mysql::__construct怎么用?PHP Mysql::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mysql
的用法示例。
在下文中一共展示了Mysql::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($port){ //重写了继承过父类的参数
//有了保险,选继承父类的构造函数
parent::__construct();
$this->prot = $port;
$this->conn = mysql_connect("localhost:$prot", 'root', '123456');
echo $this->port,'----<br/>';
}
示例2: __construct
public function __construct($id = '')
{
parent::__construct();
$this->class = strtolower(get_class($this));
$obj = new ReflectionClass($this->class);
$this->data = $obj->getStaticPropertyValue('definitation');
if ($id != '') {
$this->where = array($this->data['primary'] => $id);
$this->order_by = array($this->data['primary'] => 'desc');
$this->return = 1;
$this->getData = $this->select();
}
}
示例3: __construct
public function __construct()
{
parent::__construct();
}
示例4: __construct
public function __construct($host, $user, $password, $dbName)
{
parent::__construct($host, $user, $password, $dbName);
}
示例5: __construct
/**
* Constructor
*
* @param array $config Array of configuration information for the Datasource.
* @param bool $autoConnect Whether or not the datasource should automatically connect.
* @throws MissingConnectionException when a connection cannot be made.
*/
public function __construct($config = null, $autoConnect = true)
{
parent::__construct($config, $autoConnect);
$this->columns['uuid'] = array('name' => 'char', 'limit' => '36');
}