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


PHP mysql::close方法代碼示例

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


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

示例1: process_message

function process_message($msg)
{
    echo "\n############ 信息日誌開始 ###############\n";
    echo date('Y-m-d H:i:s') . "=====" . $msg->body;
    echo "\n############ 信息日誌結束 ###############\n";
    //執行SQL語句
    $db_config = C("DB_CONFIG");
    $dbConn = new mysql();
    $dbConn->connect($db_config["master1"][0], $db_config["master1"][1], $db_config["master1"][2], '');
    $dbConn->select_db($db_config["master1"][4]);
    $sql = $msg->body;
    $query = $dbConn->query($sql);
    if (!$query) {
        Log::write($sql, Log::ERR);
    } else {
        echo date('Y-m-d H:i:s') . '===== [ok] ', '=====', $sql, "\n";
        //確認消費OK
        $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);
    }
    $dbConn->close();
    // Send a message with the string "quit" to cancel the consumer.
    if ($msg->body === 'quit') {
        $msg->delivery_info['channel']->basic_cancel($msg->delivery_info['consumer_tag']);
    }
}
開發者ID:ohjack,項目名稱:newErp,代碼行數:25,代碼來源:notice_power_subscribe.php

示例2: loginAction

 function loginAction($request)
 {
     include_once PATH . "/class/mysql.php";
     $db = new mysql();
     $whereArr = array("userName" => "admin");
     $db->dbconnect();
     $result = $db->getRow("user", $whereArr);
     $db->close();
     $status = 0;
     $backArr = array();
     $backArr["command"] = $request["command"];
     $backArr["action"] = $request["action"];
     $backArr["status"] = $status;
     echo json_encode($backArr);
     return json_encode($backArr);
 }
開發者ID:vvvui,項目名稱:vvvui.github.com,代碼行數:16,代碼來源:admin.php

示例3: dirname

 * ============================================================================
 * 版權所有: 騎士網絡,並保留所有權利。
 * 網站地址: http://www.74cms.com;
 * ----------------------------------------------------------------------------
 * 這不是一個自由軟件!您隻能在不用於商業目的的前提下對程序代碼進行修改和
 * 使用;不允許對程序代碼以任何形式任何目的的再發布。
 * ============================================================================
*/
define('IN_QISHI', true);
$alias = "QS_hunter_jobsshow";
require_once dirname(__FILE__) . '/../include/common.inc.php';
if ($_PLUG['hunter']['p_install'] == 1) {
    $link[0]['text'] = "返回首頁";
    $link[0]['href'] = $_CFG['site_dir'];
    showmsg("管理員已關閉此模塊!", 1, $link);
}
if ($mypage['caching'] > 0) {
    $smarty->cache = true;
    $smarty->cache_lifetime = $mypage['caching'];
} else {
    $smarty->cache = false;
}
$cached_id = $alias . (isset($_GET['id']) ? "|" . intval($_GET['id']) % 100 . '|' . intval($_GET['id']) : '') . (isset($_GET['page']) ? "|p" . intval($_GET['page']) % 100 : '');
require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
$db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
unset($dbhost, $dbuser, $dbpass, $dbname);
$mypage['tpl'] = '../tpl_hunter/default/' . $mypage['tpl'];
$smarty->assign('user_tpl', '../tpl_hunter/');
$smarty->display($mypage['tpl'], $cached_id);
$db->close();
unset($smarty);
開發者ID:winiceo,項目名稱:job,代碼行數:31,代碼來源:hunter-jobs-show.php

示例4: function

$channel->exchange_declare($exchange_name, 'fanout', false, false, false);
$channel->queue_declare($queue_name, false, false, false, false);
$channel->queue_bind($queue_name, $exchange_name);
echo ' [*] Waiting for logs. To exit press CTRL+C', "\n";
$callback = function ($msg) {
    // global $dbConn;
    //var_dump($dbConn);
    //常連接MYSQL
    $db_config = C("DB_CONFIG");
    $dbConn = new mysql();
    $dbConn->connect($db_config["master1"][0], $db_config["master1"][1], $db_config["master1"][2], '');
    $dbConn->select_db($db_config["master1"][4]);
    //$con_stat = $dbConn->ping();
    $sql = $msg->body;
    //echo $sql;echo "\n\n";
    $query = $dbConn->query(json_decode($sql));
    if (!$query) {
        //Log::write($con_stat.'---'.$sql, Log::ERR);
        Log::write($sql, Log::ERR);
    } else {
        //echo ' [ok] ', $con_stat,'---', $sql, "\n";
        echo ' [ok] ', '---', $sql, "\n";
    }
    $dbConn->close();
};
$channel->basic_consume($queue_name, '', false, true, false, false, $callback);
while (count($channel->callbacks)) {
    $channel->wait();
}
$channel->close();
$connection->close();
開發者ID:ohjack,項目名稱:newErp,代碼行數:31,代碼來源:purchase_comversion_subscribe.php

示例5: array

$mysql->query('TRUNCATE TABLE `tba_records`');


$events = array();
foreach($tba->get_attendance(null,$conf['team']) as $attended){
	$mysql->query("INSERT INTO `tba_attendance` VALUES ({$attended['attendanceid']}, {$attended['teamnumber']}, {$attended['eventid']});");
	if(!in_array($attended['eventid'], $events)){
		$events[] = $attended['eventid'];
	}
}
foreach($events as $event){
	$evnt = $tba->get_events($event, null, null);
	$record = $tba->get_official_record($conf['team'],$evnt[0]['eventid'],null);
	$mysql->query("INSERT INTO `tba_events` VALUES ('{$evnt[0]['eventid']}', '{$evnt[0]['name']}', '{$evnt[0]['year']}', '{$evnt[0]['week']}', '{$evnt[0]['location']}', '{$evnt[0]['official']}','{$evnt[0]['tba_link']}', '{$record[0]['win']}', '{$record[0]['loose']}', '{$record[0]['tie']}', '{$record[0]['string']}', '{$record[0]['sum']}');");
}
$matches = $tba->get_matches($conf['team']);
foreach($matches as $match){
	$mysql->query("INSERT INTO `tba_matches` VALUES ('{$match['matchid']}', '{$match['eventid']}', '{$match['matchname']}', '{$match['complevel']}', '{$match['matchnumber']}', '{$match['red1']}', '{$match['red2']}', '{$match['red3']}', '{$match['blue1']}', '{$match['blue2']}', '{$match['blue3']}', '{$match['bluescore']}', '{$match['redscore']}', '{$match['tba_link']}', '{$match['video_url']}');");
}

foreach($conf['games'] as $year => $game){
	$record = $tba->get_official_record($conf['team'],null,$year);
	$mysql->query("INSERT INTO `tba_records` VALUES ('{$year}', '{$record[0]['win']}', '{$record[0]['lose']}', '{$record[0]['tie']}', '{$record[0]['string']}', '{$record[0]['sum']}');");
}


$mysql->close();
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "$time seconds, {$mysql->qcount} querries";
?>
開發者ID:ksiegel,項目名稱:FRC-CMS,代碼行數:31,代碼來源:update.php

示例6: SetFlux

function SetFlux($type, $col, $id, $valeur)
{
    global $objSite;
    // requête pour vérifier l'existence de la traduction
    /*
    $Xpath = "/EvalActiSem/Querys/Query[@fonction='ExeAjax-AddTrad-VerifExist']";
    $Q = $objSite->XmlParam->GetElements($Xpath);
    $where = str_replace("-id10eF-", $id10eF, $Q[0]->where);
    $where = str_replace("-idIeml-", $idIeml, $where);
    $sql = $Q[0]->select.$Q[0]->from.$where;
    */
    $sql = "INSERT INTO ieml_flux (flux_ieml, flux_date) \r\n                        VALUES ('" . $type . $col . $id . $valeur . "',now())";
    $db = new mysql($objSite->infos["SQL_HOST"], $objSite->infos["SQL_LOGIN"], $objSite->infos["SQL_PWD"], $objSite->infos["SQL_DB"], $dbOptions);
    $db->connect();
    $result = $db->query($sql);
    $message = mysql_affected_rows() . " modifiée";
    $db->close();
    return $message;
}
開發者ID:goldman20002,項目名稱:jeje,代碼行數:19,代碼來源:ExeAjax.php


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