Пример #1
0
 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);
         }
     }
 }
Пример #2
0
 public function Update($table, $column, $value1, $where, $value2)
 {
     try {
         $sqlString = parent::UpdateString($table, $column, $where);
         $statement = $this->isConnect->prepare($sqlString);
         $statement = parent::bindState($statement, $column, $value1);
         $statement = parent::bindState($statement, $where, $value2);
         $statement->execute();
     } catch (PDOException $e) {
         parent::ErrorException('Update', $e, $sqlString);
     }
 }