本文整理汇总了PHP中Conn::getConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP Conn::getConnection方法的具体用法?PHP Conn::getConnection怎么用?PHP Conn::getConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conn
的用法示例。
在下文中一共展示了Conn::getConnection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: BackupDatabase
public function BackupDatabase($database)
{
$connection = parent::getConnection();
// try{
// $backup = $connection->prepare('mysqldump -u root -p 123456 '. $database .' > ' . HOME . 'archives/backup.sql');
// $backup->execute();
// return true;
// }catch(Exception $e){
// return false;
// $this->result = $e;
// }
return system('mysqldump -u root -p 123456 ' . $database . ' > ' . HOME . 'archives/backup.sql');
}
示例2: query
public static function query($sql, $link_identifier = NULL)
{
if (empty($sql)) {
throw new MyException('empty sql');
//return null;
}
if (empty($link_identifier)) {
$link_identifier = Conn::getConnection();
}
// var_dump($sql);
// var_dump($link_identifier);
$result = mysql_query($sql, $link_identifier);
if (!$result) {
throw new MyException("Fail query: ({$sql}) mysql_error: " . mysql_error());
//return null;
return NULL;
}
return $result;
}
示例3: getCon
/**
* PRIVATE METHODS - Métodos privados para uso interno da classe
*
*/
private function getCon()
{
$this->connection = parent::getConnection();
$this->update = $this->connection->prepare($this->update);
}
示例4: getCon
/**
* PRIVATE METHODS = Métodos privados para uso interno da classe
*
*/
private function getCon()
{
$this->connection = parent::getConnection();
$this->delete = $this->connection->prepare($this->query);
}
示例5: getCon
/**
* PRIVATE METHODS = Métodos privados para uso interno da classe
*
*/
private function getCon()
{
$this->connection = parent::getConnection();
$this->read = $this->connection->prepare($this->query);
$this->read->setFetchMode(PDO::FETCH_ASSOC);
}