本文整理汇总了PHP中PDOConnection::ErrorException方法的典型用法代码示例。如果您正苦于以下问题:PHP PDOConnection::ErrorException方法的具体用法?PHP PDOConnection::ErrorException怎么用?PHP PDOConnection::ErrorException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDOConnection
的用法示例。
在下文中一共展示了PDOConnection::ErrorException方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ViewerBlog
public function ViewerBlog($blog)
{
try {
$blogid = $this->GetBlogID($blog);
$viewCurrent = parent::GetValue('view', 'blog', 'blogid', $blogid);
$viewCurrent++;
$sqlString = 'UPDATE ' . $this->isConfig[$this->isSite]['table'] . 'blog SET view=:view WHERE blogid=:blogid;';
$statement = $this->isConnect->prepare($sqlString);
$statement = $this->bindState($statement, array('view', 'blogid'), array($viewCurrent, $blogid));
$statement->execute();
} catch (PDOException $e) {
parent::ErrorException('CountRow', $e, $sqlString);
}
}
示例2: __construct
public function __construct()
{
parent::__construct();
$userid = ereg_replace('\\.', '', $_SERVER['REMOTE_ADDR']);
$expires = time() + 1200;
$table = 'user_online';
$column = array('expires', 'uid', 'mag_id', 'guest');
$values = array($expires, $userid, 0, 1);
if (parent::CountRow($table, 'uid', $userid) < 1) {
try {
$sqlString = parent::InsertString($table, $column);
$statement = $this->isConnect->prepare($sqlString);
$statement = parent::bindState($statement, $column, $values);
$statement->execute();
} catch (PDOException $e) {
parent::ErrorException('Insert', $e, $sqlString);
}
}
}
示例3: Delete
public function Delete($table, $where)
{
try {
$sqlString = parent::DeleteString($table, $where);
$statement = $this->isConnect->prepare($sqlString);
$statement->execute();
} catch (PDOException $e) {
parent::ErrorException('Delete', $e, $sqlString);
}
}
示例4: InsertComment
public function InsertComment($userid, $manganame, $comment, $timestamp, $ipaddress)
{
try {
$sqlString = 'INSERT INTO ' . $this->isConfig[$this->isSite]['table'] . 'comment (userid, manga, comment, created, ip)';
$sqlString .= ' VALUES (:userid, :manga, :comment, :created, :ip);';
$statement = $this->isConnect->prepare($sqlString);
$statement = $this->bindState($statement, array('userid', 'manga', 'comment', 'created', 'ip'), array($userid, $manganame, $comment, $timestamp, $ipaddress));
$statement->execute();
} catch (PDOException $e) {
parent::ErrorException('ADD Comment', $e, $sqlString);
}
}