本文整理匯總了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);
}