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); } }
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); } } }
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); } }
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); } }