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


PHP Db::execute方法代码示例

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


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

示例1: set

 /**
  * @param string $key
  */
 public function set($guildID, $key, $value)
 {
     $json = $this->getAll($guildID);
     $json->{$key} = $value;
     $data = json_encode($json);
     $this->db->execute("INSERT INTO settings (serverID, settings) VALUES (:serverID, :settings) ON DUPLICATE KEY UPDATE settings = :settings", array(":serverID" => $guildID, ":settings" => $data));
 }
开发者ID:sovereignbot,项目名称:citadel,代码行数:10,代码来源:ServerConfig.php

示例2: synchronize

 /**
  * @return Model
  */
 public function synchronize()
 {
     $tables = $this->db->tables();
     if (false === array_search($this->table, $tables)) {
         $properties = array();
         foreach ($this->properties as $name => $instance) {
             if (is_subclass_of($instance, 'Property')) {
                 $properties[] = "`{$name}` " . $instance->__toString();
             }
         }
         $this->db->execute("CREATE TABLE `{$this->table}` (" . implode(', ', $properties) . ")");
     }
     return $this;
 }
开发者ID:joksnet,项目名称:php-old,代码行数:17,代码来源:Model.php

示例3: updatePassword

 public static function updatePassword($password)
 {
     $userID = user::getUserID();
     $password = self::genPassword($password);
     Db::execute("UPDATE zz_users SET password = :password WHERE id = :userID", array(":password" => $password, ":userID" => $userID));
     return "Updated password";
 }
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:7,代码来源:Password.php

示例4: process

 public function process()
 {
     $db = new Db();
     $perishable_token = $this->generateToken();
     $query = "insert into user (email, password, perishable_token, last_activity_timestamp, signup_timestamp) values (" . "'" . $this->attributes['email'] . "', " . "'" . $this->attributes['password'] . "', " . "'" . $perishable_token . "', " . time() . ", " . time() . ")";
     return $db->execute($query);
 }
开发者ID:rajatsinghal,项目名称:GShare-server,代码行数:7,代码来源:signup.php

示例5: UpdateRouteAssignment

function UpdateRouteAssignment()
{
    $arrRouteAssignment = array('varRouteId' => $_POST['txtRouteId'], 'varRouteAssignment' => $_POST['txtRouteAssignment']);
    Db::execute('UPDATE routes SET assignment = :varRouteAssignment WHERE rtcode = :varRouteId', $arrRouteAssignment);
    $varResult = Db::getRow('SELECT * FROM routes WHERE rtcode = ?', $arrRouteAssignment['varRouteId']);
    echo 'Update Completed. Route assigned to ' . $varResult['assignment'];
}
开发者ID:JWFoxJr,项目名称:FundsMaster,代码行数:7,代码来源:functions.php

示例6: updatePoints

 public static function updatePoints($killID, $tempTables = false)
 {
     $points = self::calculatePoints($killID, $tempTables);
     $temp = $tempTables ? "_temporary" : "";
     Db::execute("update zz_participants{$temp} set points = :points where killID = :killID", array(":points" => $points, ":killID" => $killID));
     return $points;
 }
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:7,代码来源:Points.php

示例7: postProfile

    /**
     * @url POST profile/{userId}
     * @url PUT {userId}
     */
    protected function postProfile($userId, $firstname, $lastname, $nickname, $phone, $birthdate, $school, $province, $level, $purpose, $avatarId)
    {
        if ($userId == \TTO::getUserId()) {
            $statement = '
		  	UPDATE user SET
			  	firstname = :firstname,
			  	lastname  = :lastname, 
			  	nickname  = :nickname,
			  	phone     = :phone,
			  	birthdate = :birthdate,
			  	school    = :school,
			  	province  = :province,
			  	level     = :level,
			  	purpose   = :purpose,
			  	avatarId  = :avatarId
		  	WHERE userId = :userId
	  	';
            $bind = array('firstname' => $firstname, 'lastname' => $lastname, 'nickname' => $nickname, 'phone' => $phone, 'birthdate' => $birthdate, 'school' => $school, 'province' => $province, 'level' => $level, 'purpose' => $purpose, 'avatarId' => $avatarId, 'userId' => $userId);
            $row_update = \Db::execute($statement, $bind);
            \TTOMail::createAndSendAdmin('A user updated profile', json_encode($bind));
            $response = new \stdClass();
            $response->row_update = $row_update;
            return $response;
        } else {
            throw new RestException(401, 'No Authorize or Invalid request !!!');
        }
    }
开发者ID:tootutor,项目名称:tto-api,代码行数:31,代码来源:User.php

示例8: irc_log

function irc_log($nick, $uhost, $command, $params)
{
    $id = Db::queryField("SELECT id FROM zz_irc_access WHERE name = :nick AND host = :uhost", "id", array(":nick" => $nick, ":uhost" => $uhost));
    if ($id == null) {
        $id = 0;
    }
    Db::execute("INSERT INTO zz_irc_log (id, nick, command, parameters) VALUES (:id, :nick, :command, :params)", array(":nick" => $nick, ":id" => $id, ":command" => $command, ":params" => implode(" ", $params)));
}
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:8,代码来源:zkbBot.php

示例9: cachePrimer

 public static function cachePrimer()
 {
     Db::execute("set session wait_timeout = 120");
     self::storeResult(Db::query("select c.* from zz_characters c left join zz_participants p on (c.characterID = p.characterID) where dttm > date_sub(now(), interval 5 day) group by characterID", array(), 0), "select name from zz_characters where characterID = :id", ":id", "characterID", "name");
     self::storeResult(Db::query("select * from zz_corporations", array(), 0), "select name from zz_corporations where corporationID = :id", ":id", "corporationID", "name");
     self::storeResult(Db::query("select * from zz_alliances", array(), 0), "select name from zz_alliances where allianceID = :id", ":id", "allianceID", "name");
     self::storeResult(Db::query("select * from ccp_invTypes", array(), 0), "select typeName from invTypes where typeID = :typeID", ":typeID", "typeID", "typeName");
 }
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:8,代码来源:Primer.php

示例10: runSql

 /**
  * @param string $sql
  * @param array $params
  * @return bool|ResultSet
  */
 protected function runSql($sql, $params = array())
 {
     $rez = $this->db->execute($sql, $params);
     if (!$rez) {
         $this->logError($this->db->lastError);
     }
     return $rez;
 }
开发者ID:Interghost,项目名称:university,代码行数:13,代码来源:tlms_update_cron.php

示例11: handle

 /**
  * 定单处理
  * @param $tid 定单编号
  */
 public function handle($tid)
 {
     Db::table('balance')->where('tid', $tid)->update(array('status' => 1));
     //添加会员余额
     $balance = Db::table('balance')->where('siteid', SITEID)->where('tid', $tid)->first();
     $sql = "UPDATE " . tablename('member') . " SET credit2=credit2+{$balance['fee']} WHERE uid={$balance['uid']}";
     Db::execute($sql);
 }
开发者ID:houdunwang,项目名称:hdcms,代码行数:12,代码来源:pay.php

示例12: delete

 /**
  * 删除数据
  *
  * @param string $table            
  * @param string $where            
  */
 public function delete($where = null, $table = '')
 {
     if (empty($table)) {
         $table = $this->table;
     }
     $sql = 'DELETE FROM ' . $table . (is_null($where) ? '' : ' WHERE ' . (is_array($where) ? implode(' AND ', $where) : $where));
     return $this->db->execute($sql);
 }
开发者ID:frycnx,项目名称:jxc,代码行数:14,代码来源:Model.php

示例13: consumeNonce

function consumeNonce($form)
{
    $now = time();
    if (!isset($form['nonce']) || $form['nonce'] != $_SESSION['hg_nonce'] || !preg_match('/^\\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\dZ/', $form['nonce'], $ma) || !($timestamp = strtotime($ma[0])) || $timestamp > $now || $timestamp < $now - 60 * 60 || Db::scalarQuery('SELECT stamp FROM jos_oauthp_nonces WHERE nonce = ?', array($form['nonce']))) {
        //throw new Exception('Bad token', 405);
    }
    Db::execute('UPDATE jos_oauthp_nonces SET stamp = 1 WHERE nonce = ?', array($form['nonce']));
    unset($_SESSION['hg_nonce']);
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:9,代码来源:hubgraph.php

示例14: save

 public function save()
 {
     $params = json_encode($this->settings);
     $updateQuery = 'UPDATE jos_extensions SET params = ? WHERE `type`=\'component\' AND `element` = \'com_hubgraph\'';
     $insertQuery = 'INSERT INTO jos_extensions(name, `type`, `element`, params) VALUES (\'HubGraph\', \'component\', \'com_hubgraph\', ?)';
     if (!Db::update($updateQuery, array($params))) {
         Db::execute($insertQuery, array($params));
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:9,代码来源:client.php

示例15: updateJEditableField

function updateJEditableField($table, $field, $value, $id)
{
    $data = array('id' => $id, 'value' => $value);
    try {
        Db::execute("UPDATE {$table} SET {$field} = :value WHERE id = :id", $data);
        echo nl2br($value);
    } catch (Exception $e) {
        echo 'Error occured';
    }
}
开发者ID:icakir,项目名称:kanban-board,代码行数:10,代码来源:ajax.php


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