本文整理汇总了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}");
}
示例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>
示例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__);
}
}