當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SmrMySqlDatabase::unlock方法代碼示例

本文整理匯總了PHP中SmrMySqlDatabase::unlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP SmrMySqlDatabase::unlock方法的具體用法?PHP SmrMySqlDatabase::unlock怎麽用?PHP SmrMySqlDatabase::unlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SmrMySqlDatabase的用法示例。


在下文中一共展示了SmrMySqlDatabase::unlock方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: rand

 $dead_ppl->query("SELECT *\n\t\t\t\t\t  FROM kills\n\t\t\t\t\t  WHERE game_id = {$player->game_id} AND\n\t\t\t\t\t  processed = 'FALSE'\n\t\t\t\t\t  ORDER BY rand()\n\t\t\t\t\t  LIMIT 1\n\t\t\t\t\t ");
 // did we get one result?
 if ($dead_ppl->next_record()) {
     // get their id's
     $killed_id = $dead_ppl->f("dead_id");
     $killer_id = $dead_ppl->f("killer_id");
     $curr_sector = $dead_ppl->f("sector_id");
     $dead_exp = $dead_ppl->f("dead_exp");
     $kill_exp = $dead_ppl->f("kill_exp");
     // we have to set the 'process' column to true here
     // BEFORE we give access free to that table.
     // otherwise another thread could pick this row up
     // but we cannot delte the entry before we sent that poor guy back to his hq
     $db->query("UPDATE kills SET processed = 'TRUE' WHERE game_id = {$player->game_id} AND dead_id = {$killed_id} AND killer_id = {$killer_id}");
     // give table free
     $dead_ppl->unlock();
     if ($debug) {
         print "<p>report any errors on that page to spock</p>";
     }
     // create player object
     // JUST FOR READING!!!
     // DO NOT CHANGE SOMETHING IN THERE!
     $killed = new SMR_PLAYER($killed_id, SmrSession::$game_id);
     $killer = new SMR_PLAYER($killer_id, SmrSession::$game_id);
     // is one of the dead guys the original attacker or defender?
     if ($killed_id == $defender_id || $killed_id == $attacker_id) {
         $container["continue"] = "No";
     }
     // save some time here
     $killer_name = get_colored_text($killer->alignment, $killer->player_name);
     $killed_name = get_colored_text($killed->alignment, $killed->player_name);
開發者ID:smrealms,項目名稱:smrv2.0,代碼行數:31,代碼來源:trader_attack_processing.php

示例2: forward

        $container['account_id'] = $album_id;
        forward($container);
        exit;
    }
    $db = new SmrMySqlDatabase();
    if (!isset($_GET['comment']) || empty($_GET['comment'])) {
        create_error_offline('Please enter a comment.');
    } else {
        $comment = $_GET['comment'];
    }
    // get current time
    $curr_time = TIME;
    $comment = word_filter($comment);
    $account->sendMessageToBox(BOX_ALBUM_COMMENTS, $comment);
    // check if we have comments for this album already
    $db->lockTable('album_has_comments');
    $db->query('SELECT MAX(comment_id) FROM album_has_comments WHERE album_id = ' . $db->escapeNumber($album_id));
    if ($db->nextRecord()) {
        $comment_id = $db->getField('MAX(comment_id)') + 1;
    } else {
        $comment_id = 1;
    }
    $db->query('INSERT INTO album_has_comments
				(album_id, comment_id, time, post_id, msg)
				VALUES (' . $db->escapeNumber($album_id) . ', ' . $db->escapeNumber($comment_id) . ', ' . $db->escapeNumber($curr_time) . ', ' . $db->escapeNumber($account->getAccountID()) . ', ' . $db->escapeString($comment) . ')');
    $db->unlock();
    header('Location: ' . URL . '/album/?' . get_album_nick($album_id));
    exit;
} catch (Exception $e) {
    handleException($e);
}
開發者ID:smrealms,項目名稱:smrv2.0,代碼行數:31,代碼來源:album_comment.php


注:本文中的SmrMySqlDatabase::unlock方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。