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


PHP MYSQL::SqlDelete方法代碼示例

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


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

示例1: SetLogout

 function SetLogout(&$smarty, $redir = 'index')
 {
     $mysql = new MYSQL($smarty);
     $sql = $mysql->SqlDelete($smarty->cfg["prefix"] . 'log_online', "identity='" . $smarty->perfil["ID_MEMBER"] . "'");
     $result = mysql_query($sql);
     $cookie_url = explode($smarty->cfg["separate"], $this->url_parts($smarty->get_config_vars('http'), $smarty->cfg["separate"]));
     setcookie($smarty->cfg["cookie"], '', time() - 3600, $cookie_url[1], $cookie_url[0]);
     $smarty->perfil = $smarty->LoadPerfilGuest();
     $redir = $smarty->get_config_vars('http') . $smarty->cfg['index'] . '?page=' . $redir;
     header("location:{$redir}");
 }
開發者ID:renatoinnocenti,項目名稱:ModulosZend,代碼行數:11,代碼來源:lib.Login.php

示例2: MYSQL

$tabela = 'produtos';
$mysql = new MYSQL($cfg);
if ($_POST['add']) {
    // adicionar registro.
    array_pop($_POST);
    $sql = $mysql->SqlInsert($tabela, $_POST);
    $request = $mysql->SqlSelect($sql, __FILE__, __LINE__);
    if ($request) {
        print "<h4>Registro Realizado com sucesso!!!</h4>";
    }
}
if ($_POST['del']) {
    // adicionar registro.
    $idde = trim($_POST['id']);
    $sql = $mysql->SqlDelete($tabela, "id = '{$idde}'");
    $request = $mysql->SqlSelect($sql, __FILE__, __LINE__);
    if ($request) {
        print "<h4>Registro Deletado com sucesso!!!</h4>";
    }
}
$result = $mysql->SqlSelect("SELECT id, nome, descricao, preco FROM {$tabela}");
if ($result) {
    ?>

<div class="col-md-6">
	<table class="table table-striped">
		<thead>
			<tr>
				<th>#</th>
				<th>Nome</th>
開發者ID:renatoinnocenti,項目名稱:Serviceit-php,代碼行數:30,代碼來源:produtos_list.php

示例3: logMe

 public function logMe($ID_MEMBER, $min = '15')
 {
     $mysql = new MYSQL($this);
     $tabela = $this->cfg['db_prefix'] . 'log_online';
     $logme['identity'] = $ID_MEMBER;
     $perfil['member_lastlogin'] = $logme['logTime'] = 'NOW()';
     $perfil['member_lestonline'] = $logme['logoutTime'] = "NOW() + INTERVAL " . $min . " MINUTE";
     $logme['url'] = $this->actualpage['page_name'] ? $this->actualpage['page_name'] : "index";
     $logme['ip'] = $_SERVER['REMOTE_ADDR'];
     $request = $mysql->SqlSelect("Select identity From {$tabela} where ip = \"{$logme[ip]}\" and identity = \"{$ID_MEMBER}\"", __FILE__, __LINE__);
     mysql_affected_rows();
     if (mysql_affected_rows() > 0) {
         $sql = $mysql->SqlUpdate($tabela, $logme, "identity = {$ID_MEMBER}");
     } else {
         $sql = $mysql->SqlInsert($tabela, $logme);
     }
     $request = $mysql->SqlSelect($sql, __FILE__, __LINE__);
     $tabela = $this->cfg['db_prefix'] . 'log_online';
     $sql = $mysql->SqlUpdate($tabela, $logme, "identity =" . $ID_MEMBER);
     $request = $mysql->SqlSelect($sql, __FILE__, __LINE__);
     $sql = $mysql->SqlDelete($tabela, "logoutTime < NOW()");
     $request = $mysql->SqlSelect($sql, __FILE__, __LINE__);
     if ($ID_MEMBER > 0) {
         $tabela = $this->cfg['db_prefix'] . 'members';
         $sql = $mysql->SqlUpdate($tabela, $perfil, "ID_MEMBER =" . $ID_MEMBER);
         $request = $mysql->SqlSelect($sql, __FILE__, __LINE__);
     }
 }
開發者ID:renatoinnocenti,項目名稱:ModulosZend,代碼行數:28,代碼來源:lib.StartSite.php


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