当前位置: 首页>>代码示例>>PHP>>正文


PHP Sql::pUpdate方法代码示例

本文整理汇总了PHP中Sql::pUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP Sql::pUpdate方法的具体用法?PHP Sql::pUpdate怎么用?PHP Sql::pUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sql的用法示例。


在下文中一共展示了Sql::pUpdate方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: write

 public function write($id, $data)
 {
     $time = time() + $this->expire_time;
     $q = 'REPLACE tblSessionData (session_id,session_data,expires) VALUES(?, ?, ?)';
     Sql::pUpdate($q, 'sss', $id, $data, sql_datetime($time));
     return true;
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:7,代码来源:SessionStorageHandler.php

示例2: store

 public function store()
 {
     $q = 'SELECT id FROM ' . self::$tbl_name . ' WHERE owner = ? AND season = ? AND episode = ?';
     $this->id = Sql::pSelectItem($q, 'iii', $this->owner, $this->season, $this->episode);
     if ($this->id) {
         $q = 'UPDATE ' . self::$tbl_name . ' SET owner = ?, title = ?, date = ?, info = ?, season = ?, episode = ?, link = ? WHERE id = ?';
         Sql::pUpdate($q, 'isssiisi', $this->owner, $this->title, $this->date, $this->info, $this->season, $this->episode, $this->link, $this->id);
         return $this->id;
     }
     $q = 'INSERT INTO ' . self::$tbl_name . ' SET owner = ?, title = ?, date = ?, info = ?, season = ?, episode = ?, link = ?';
     return Sql::pInsert($q, 'isssiis', $this->owner, $this->title, $this->date, $this->info, $this->season, $this->episode, $this->link);
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:12,代码来源:TvEpisode.php

示例3: set

 public static function set($type, $owner, $name, $val)
 {
     $q = 'SELECT id FROM ' . self::$tbl_name . ' WHERE owner = ? AND type = ? AND name = ?';
     if (Sql::pSelectItem($q, 'iis', $owner, $type, $name)) {
         $q = 'UPDATE ' . self::$tbl_name . ' SET time_saved = NOW(), value = ?' . ' WHERE owner = ? AND type = ? AND name = ?';
         Sql::pUpdate($q, 'siis', $val, $owner, $type, $name);
     } else {
         $q = 'INSERT INTO ' . self::$tbl_name . ' SET time_saved = NOW(),' . 'owner = ?, type = ?, name = ?, value = ?';
         Sql::pInsert($q, 'iiss', $owner, $type, $name, $val);
     }
     return true;
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:12,代码来源:Setting.php

示例4: sync

 /** Updates tblFiles entry with current file size & mime type, useful after Image resize / rotate etc */
 public static function sync($id)
 {
     $name = self::getUploadPath($id);
     if (!file_exists($name)) {
         throw new \Exception('cant sync nonexisting file, what do???');
     }
     $size = filesize($name);
     $mime = get_mimetype_of_file($name);
     $q = 'UPDATE tblFiles' . ' SET size = ?, mimetype = ?' . ' WHERE id = ?';
     Sql::pUpdate($q, 'isi', $size, $mime, $id);
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:12,代码来源:File.php

示例5: logout

 /** Logs out the user */
 function logout()
 {
     dp($this->username . ' logged out');
     if (!$this->id) {
         throw new \Exception('already logged out');
     }
     Sql::pUpdate('UPDATE tblUsers SET time_last_logout = NOW() WHERE id = ?', 'i', $this->id);
     $params = session_get_cookie_params();
     setcookie(session_name(), '', time() - 604800, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
     $page = XmlDocumentHandler::getInstance();
     $show_page = $this->logged_out_start_page ? $this->logged_out_start_page : $page->getRelativeUrl();
     header('Location: ' . $show_page);
     $this->end();
     die;
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:16,代码来源:SessionHandler.php

示例6: remove

 /**
  * Marks specified user as "deleted"
  */
 public function remove()
 {
     // also removes user from all user groups
     foreach (UserGroupHandler::getGroups($this->id) as $grp) {
         UserGroupHandler::removeFromGroup($this->id, $grp->id);
     }
     $q = 'UPDATE tblUsers SET time_deleted = NOW() WHERE id = ?';
     Sql::pUpdate($q, 'i', $this->id);
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:12,代码来源:User.php

示例7: save

 function save()
 {
     $session = SessionHandler::getInstance();
     if (!$this->id) {
         $q = 'SELECT groupId FROM tblUserGroups WHERE name = ?';
         $this->id = Sql::pSelectItem($q, 's', $this->name);
     }
     if ($this->id) {
         $q = 'UPDATE tblUserGroups SET name = ?, info = ?, level = ? WHERE groupId = ?';
         Sql::pUpdate($q, 'ssii', $this->name, $this->info, $this->level, $this->id);
     } else {
         $q = 'INSERT INTO tblUserGroups SET createdBy = ?, timeCreated = NOW(), name = ?, info = ?, level = ?';
         $this->id = Sql::pInsert($q, 'issi', $session->id, $this->name, $this->info, $this->level);
     }
     return $this->id;
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:16,代码来源:UserGroup.php

示例8: updateId

 public static function updateId($obj, $tblname, $field_name = 'id')
 {
     if (!is_alphanumeric($tblname) || !is_alphanumeric($field_name)) {
         throw new \Exception('very bad');
     }
     if (!$obj->{$field_name}) {
         d($obj);
         throw new \Exception('eehh');
     }
     $reflect = self::reflectQuery($obj, $field_name);
     $q = 'UPDATE ' . $tblname . ' SET ' . implode(', ', $reflect->cols) . ' WHERE ' . $field_name . ' = ?';
     $reflect->str .= is_numeric($obj->{$field_name}) ? 'i' : 's';
     $reflect->vals[] = $obj->{$field_name};
     return Sql::pUpdate($q, $reflect->str, $reflect->vals);
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:15,代码来源:SqlObject.php

示例9: deleteByOwner

 public static function deleteByOwner($type, $owner)
 {
     $session = SessionHandler::getInstance();
     $q = 'UPDATE ' . self::$tbl_name . ' SET deleted_by = ?, time_deleted = NOW()' . ' WHERE type = ? AND owner = ?';
     Sql::pUpdate($q, 'iii', $session->id, $type, $owner);
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:6,代码来源:Comment.php

示例10: removePoll

 static function removePoll($id)
 {
     $session = SessionHandler::getInstance();
     $q = 'UPDATE tblPolls SET deleted_by = ?, time_deleted = NOW() WHERE id = ?';
     Sql::pUpdate($q, 'ii', $session->id, $id);
 }
开发者ID:martinlindhe,项目名称:core_dev,代码行数:6,代码来源:PollItem.php


注:本文中的Sql::pUpdate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。