本文整理汇总了PHP中sql::update方法的典型用法代码示例。如果您正苦于以下问题:PHP sql::update方法的具体用法?PHP sql::update怎么用?PHP sql::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sql
的用法示例。
在下文中一共展示了sql::update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logout
function logout()
{
$sql = new sql();
$table = "session";
$campos = "date_logout=now()";
$where = "session='" . $_SESSION['session'] . "'";
$sql->update($table, $campos, $where, 'N');
$_SESSION['cod_usuario'] = "";
$_SESSION['user'] = "";
$_SESSION['loged'] = false;
$_SESSION['session'] = "";
$_SESSION['cod_empresa'] = "";
$_SESSION['razao_social'] = "";
$_SESSION['endereco'] = "";
$_SESSION['numero'] = "";
$_SESSION['complemento'] = "";
$_SESSION['cep'] = "";
$_SESSION['cidade'] = "";
$_SESSION['uf'] = "";
$_SESSION['cnpj'] = "";
$_SESSION['logo'] = "";
$_SESSION['email'] = "";
$_SESSION['telefone'] = "";
//header("Location: index.php");
}
示例2: sortTable
public static function sortTable($table, $sort, $where = '', $select = ['id', 'sort'])
{
if ($where) {
$where = ' WHERE ' . $where;
}
$update = new sql();
$update->setTable($table);
$i = 1;
$sql = new sql();
$sql->query('SELECT `' . $select[0] . '`, `' . $select[1] . '` FROM ' . self::table($table) . $where . ' ORDER BY `' . $select[1] . '` ASC')->result();
while ($sql->isNext()) {
if ($sort == $i) {
$i++;
}
$update->addPost($select[1], $i);
$update->setWhere($select[0] . '=' . $sql->get($select[0]));
$update->update();
$sql->next();
$i++;
}
}
示例3: rex_copyMeta
/**
* Kopiert die Metadaten eines Artikels in einen anderen Artikel
*
* @param $from_id ArtikelId des Artikels, aus dem kopiert werden (Quell ArtikelId)
* @param $to_id ArtikelId des Artikel, in den kopiert werden sollen (Ziel ArtikelId)
* @param [$from_clang] ClangId des Artikels, aus dem kopiert werden soll (Quell ClangId)
* @param [$to_clang] ClangId des Artikels, in den kopiert werden soll (Ziel ClangId)
* @param [$params] Array von Spaltennamen, welche kopiert werden sollen
*/
function rex_copyMeta($from_id, $to_id, $from_clang = 0, $to_clang = 0, $params = array())
{
global $REX, $REX_USER;
$from_clang = (int) $from_clang;
$to_clang = (int) $to_clang;
$from_id = (int) $from_id;
$to_id = (int) $to_id;
if (!is_array($params)) {
$params = array();
}
if ($from_id == $to_id && $from_clang == $to_clang) {
return false;
}
$gc = new sql();
$gc->setQuery("select * from " . $REX['TABLE_PREFIX'] . "article where clang='{$from_clang}' and id='{$from_id}'");
if ($gc->getRows() == 1) {
$uc = new sql();
// $uc->debugsql = 1;
$uc->setTable($REX['TABLE_PREFIX'] . "article");
$uc->where("clang='{$to_clang}' and id='{$to_id}'");
$uc->setValue("updatedate", time());
$uc->setValue("updateuser", addslashes($REX_USER->getValue("login")));
foreach ($params as $key => $value) {
$var = $gc->getValue("{$value}");
$uc->setValue("{$value}", $var);
}
$uc->update();
rex_generateArticle($to_id, false);
return true;
}
return false;
}
示例4: update
/**
* The select method, call sql::update().
*
* @param string $table
* @access public
* @return object the dao object self.
*/
public function update($table)
{
$this->setMode('raw');
$this->setMethod('update');
$this->sqlobj = sql::update($table);
$this->setTable($table);
return $this;
}
示例5: mktime
$meta_sql->setValue("online_from", mktime(0, 0, 0, $monat_von, $tag_von, $jahr_von));
$meta_sql->setValue("online_to", mktime(0, 0, 0, $monat_bis, $tag_bis, $jahr_bis));
$meta_sql->setValue("keywords", $meta_keywords);
$meta_sql->setValue("description", $meta_description);
$meta_sql->setValue("name", $meta_article_name);
$meta_sql->setValue("type_id", $type_id);
if (!isset($meta_teaser)) {
$meta_teaser = 0;
}
$meta_sql->setValue("teaser", $meta_teaser);
$meta_sql->setValue("updatedate", time());
$meta_sql->setValue("updateuser", $REX_USER->getValue("login"));
// -------------------------- FILE UPLOAD META BILD/FILE
$meta_sql->setValue("file", $REX_MEDIA_1);
// ----------------------------- / FILE UPLOAD
$meta_sql->update();
$article->setQuery("select * from " . $REX['TABLE_PREFIX'] . "article where id='{$article_id}' and clang='{$clang}'");
if (!isset($message)) {
$message = '';
}
$err_msg = $I18N->msg("metadata_updated") . $message;
rex_generateArticle($article_id);
}
$typesel = new select();
$typesel->set_name("type_id");
$typesel->set_style("width:100%;");
$typesel->set_size(1);
$typesql = new sql();
$typesql->setQuery("select * from " . $REX['TABLE_PREFIX'] . "article_type order by name");
for ($i = 0; $i < $typesql->getRows(); $i++) {
$typesel->add_option($typesql->getValue("name"), $typesql->getValue("type_id"));
示例6: deleteMessage
function deleteMessage($message_id)
{
// reply
$r_sql = new sql();
$r_sql->setQuery("select * from rex_5_board where message_id='{$message_id}' and board_id='" . $this->boardname . "'");
if ($r_sql->getRows() == 1) {
if ($r_sql->getValue("re_message_id") != 0) {
// reply
$ur_sql = new sql();
$ur_sql->setTable("rex_5_board");
$ur_sql->where("message_id='{$message_id}'");
$ur_sql->setValue("status", 0);
$ur_sql->update();
$message_id = $r_sql->getValue("re_message_id");
// update topic
$u_sql = new sql();
$u_sql->setQuery("select * from rex_5_board where re_message_id='{$message_id}' and status='1'");
$u_sql->setTable("rex_5_board");
$u_sql->where("message_id='{$message_id}'");
$u_sql->setValue("replies", $u_sql->getRows());
$u_sql->update();
$this->msg["bb_msg_id"] = $r_sql->getValue("re_message_id");
$return = $this->showMessage();
} else {
// topic
$u_sql = new sql();
$u_sql->setTable("rex_5_board");
$u_sql->where("message_id='{$message_id}' or re_message_id='{$message_id}'");
$u_sql->setValue("status", 0);
$u_sql->update();
$this->errmsg = $this->text[250];
$return = $this->showMessages();
}
} else {
$this->errmsg = $this->text[260];
$return = $this->showMessages();
}
return $return;
}
示例7: sql
// --------------------- ARTIKEL EDIT
$Position_Article = (int) $Position_Article;
if ($Position_Article == 0) {
$Position_Article = 1;
}
$amessage = $I18N->msg("article_updated");
$EA = new sql();
$EA->setTable($REX['TABLE_PREFIX'] . "article");
$EA->where("id='{$article_id}' and clang={$clang}");
$EA->setValue("name", $article_name);
$EA->setValue("template_id", $template_id);
// $EA->setValue("path",$KATPATH);
$EA->setValue("updatedate", time());
$EA->setValue("updateuser", $REX_USER->getValue("login"));
$EA->setValue("prior", $Position_Article);
$EA->update();
// ----- PRIOR
rex_newArtPrio($category_id, $clang, $Position_Article, $thisArt->getValue("prior"));
rex_generateArticle($article_id);
// ----- EXTENSION POINT
$message = rex_register_extension_point('ART_UPDATED', $message, array("id" => $article_id, "status" => $thisArt->getValue("status"), "name" => $article_name, "clang" => $clang, "re_id" => $category_id, "prior" => $Position_Article, "path" => $KATPATH, "template_id" => $template_id));
} elseif (isset($function) and $function == "delete_article" && $article_id != "" && $KATPERM && !$REX_USER->isValueOf("rights", "editContentOnly[]")) {
// --------------------- ARTIKEL DELETE
$message = rex_deleteArticle($article_id);
$re_id = $thisArt->getValue("re_id");
// ----- PRIO
$CL = $REX['CLANG'];
reset($CL);
for ($j = 0; $j < count($CL); $j++) {
$mlang = key($CL);
rex_newArtPrio($thisArt->getValue("re_id"), $mlang, 0, 1);
示例8: data_
<?php
session_start();
include "../../../php/login.php";
include "php.php";
include "config.php";
$sql = new sql();
function data_($data)
{
if ($data != null) {
$data = str_replace('/', '-', $data);
return date('Y-m-d', strtotime($data));
}
}
$login = new login();
$login->checklogin();
if (isset($_SESSION['loged']) and $_SESSION['loged'] == true) {
if (isset($_POST['act']) and $_POST['act'] == "conciliar" and isset($_POST['itens']) and $_POST['itens'] != "") {
$key = md5(mt_rand(1, 10000) . strtotime(date('Y-m-d H:i:s')));
$itens = explode(',', $_POST['itens']);
$tabela = "cad_documento_item";
$campos = "data_ultima_alteracao=DATE_FORMAT(now(),'%Y-%m-%d'), cod_documento_compensacao='" . $key . "' ";
for ($n = 1; $n < count($itens); $n++) {
$where = "cod_documento_item='" . $itens[$n] . "'";
$sql->update($tabela, $campos, $where, 'S');
}
}
}
示例9: getimagesize
$size = getimagesize($REX[INCLUDE_PATH] . "/../../files/{$filename}");
$fwidth = $size[0];
$fheight = $size[1];
$width = $width + 0;
$height = $height + 0;
if ($width > 0 and $height > 0 and $fwidth != $width and $fheight != $height) {
media_resize($REX[MEDIAFOLDER] . "/{$filename}", $width, $height);
$msg .= "<br>" . $I18N->msg('pool_file_is_resized');
} elseif ($width > 0 and $fwidth != $width) {
media_resize($REX[MEDIAFOLDER] . "/{$filename}", $width, $height);
$msg .= "<br>" . $I18N->msg('pool_file_is_resized');
} elseif ($height > 0 and $fheight != $height) {
media_resize($REX[MEDIAFOLDER] . "/{$filename}", $width, $height);
$msg .= "<br>" . $I18N->msg('pool_file_is_resized');
}
$FILESQL->update();
} else {
$msg = $I18N->msg('pool_file_not_found');
$mode = "";
}
}
if ($mode == "detail") {
$gf = new sql();
if ($file_name != "") {
$gf->setQuery("select * from rex_file where filename='{$file_name}'");
}
if ($gf->getRows() == 1) {
$file_id = $gf->getValue("file_id");
}
$gf->setQuery("select * from rex_file where file_id='{$file_id}'");
if ($gf->getRows() == 1) {
示例10: sql
$body = str_replace("###LOGIN###", $gu->getValue("user_login"), $body);
$body = str_replace("###PSW###", $gu->getValue("user_password"), $body);
$mail->Subject = $subject;
$mail->AltBody = $body;
$mail->Send();
echo "Mail wurde versendet<br /><br />";
$aktionen = $mails[$mail_id]["action"];
if (is_array($aktionen)) {
$uu = new sql();
$uu->debugsql = 0;
$uu->setTable("rex_5_user");
$uu->where("id='" . $oid . "'");
foreach ($aktionen as $key => $value) {
$uu->setValue($key, $value);
}
$uu->update();
echo "Aktion/en wurden ausgeführt!<br /><br />";
}
} else {
foreach ($mails as $key => $value) {
echo "<br /><br /><a href=index.php?page=community&subpage=user&oid={$oid}&func=sendmail&subfunc=send&mail_id={$key}>» " . $value["name"] . "</a>";
}
echo "<br /><br />";
}
echo "</td></tr></table>";
echo "<br /><table cellpadding=5 class=rex><tr><td><a href=index.php?page=" . $mypage . "&subpage=" . $subpage . "&func=edit&oid={$oid}><b>« Zurück zum User</b></a></td></tr></table>";
$func = "nothing";
} else {
// kein exit -> fehler -> zurueck zur übersicht
unset($oid);
}
示例11: elseif
$updateuser->setValue("newsletter", $unewsletter);
if ($ushowinfo != "") {
$ushowinfo = 1;
} else {
$ushowinfo = 0;
}
$updateuser->setValue("showinfo", $ushowinfo);
if ($usendmail != "") {
$usendmail = 1;
} else {
$usendmail = 0;
}
// Markus => http://forum.redaxo.de/viewtopic.php?t=235
$updateuser->setValue("sendmail", $usendmail);
echo $usendmail;
$updateuser->update();
$user_id = 0;
$function = "";
$message = "Benutzerdaten wurden aktualisiert !";
} elseif ($FDEL != "") {
$deleteuser = new sql();
$deleteuser->query("delete from rex__user where id='{$user_id}'");
$deleteuser->query("delete from rex__article_comment where user_id='{$user_id}'");
$deleteuser->query("delete from rex__board where user_id='{$user_id}'");
$deleteuser->query("delete from rex__user_comment where user_id='{$user_id}' or from_user_id='{$user_id}'");
$deleteuser->query("delete from rex__user_mail where user_id='{$user_id}' or from_user_id='{$user_id}'");
$message = "Benutzer gelöscht !";
$user_id = "";
} elseif ($FADD != "" && $save == 1) {
$adduser = new sql();
$adduser->setQuery("select * from rex__user where login='{$ulogin}'");
示例12:
$SETTINGSQL->setValue("color2",$EDITcolor2);
$SETTINGSQL->setValue("color3",$EDITcolor3);
$SETTINGSQL->setValue("color4",$EDITcolor4);
$SETTINGSQL->setValue("color5",$EDITcolor5);
$SETTINGSQL->setValue("color6",$EDITcolor6);
$SETTINGSQL->setValue("color7",$EDITcolor7);
$SETTINGSQL->setValue("color8",$EDITcolor8);
$SETTINGSQL->setValue("color9",$EDITcolor9);
$SETTINGSQL->setValue("color10",$EDITcolor10);
$SETTINGSQL->setValue("color11",$EDITcolor11);
$SETTINGSQL->setValue("color12",$EDITcolor12);
$SETTINGSQL->setValue("color13",$EDITcolor13);
$SETTINGSQL->setValue("color14",$EDITcolor14);
$SETTINGSQL->setValue("color15",$EDITcolor15);
$SETTINGSQL->setValue("color16",$EDITcolor16);*/
$SETTINGSQL->update();
} else {
$errorMsg .= '<p class="warning">Einstellungen wurden nicht gespeichert.</p>';
}
}
if (!isset($aid)) {
$aid = '';
}
if (!isset($subpage)) {
$subpage = '';
}
if (!isset($EDITeditorWindow)) {
$EDITeditorWindow = '';
}
if (!isset($errorMsg)) {
$errorMsg = '';
示例13: formulario
if (isset($_POST) and isset($_POST['act']) and $_POST['act'] == 'salvar_resposta') {
//se 'cod_formulario_resposta' == 'nova_resposta'
if ($_POST['cod_formulario_resposta'] == 'nova_resposta') {
$table = "`cad_formulario_resposta`";
$campos = "`cod_formulario`, `descricao`";
$values = "'" . $_POST['cod_formulario'] . "','" . $_POST['descricao'] . "'";
$msg = "N";
$sql->insert($table, $campos, $values, $msg);
}
//se 'cod_formulario_resposta' != 'nova_resposta'
if ($_POST['cod_formulario_resposta'] != 'nova_resposta') {
$table = "cad_formulario_resposta";
$campos = "`cod_formulario`='" . $_POST['cod_formulario'] . "', `descricao`='" . $_POST['descricao'] . "' ";
$where = "cod_formulario_resposta='" . $_POST['cod_formulario_resposta'] . "'";
$msg = "N";
$sql->update($table, $campos, $where, $msg);
}
//pesquisar os atuais
echo $formulario->itens_formulario($_POST['cod_formulario']);
}
if (isset($_POST) and isset($_POST['act']) and $_POST['act'] == 'excluir_resposta') {
$table = "cad_formulario_resposta";
$where = "cod_formulario_resposta='" . $_POST['cod_formulario_resposta'] . "'";
$msg = "N";
$sql->delete($table, $where, $msg);
echo $formulario->itens_formulario($_POST['cod_formulario']);
}
if (isset($_POST) and isset($_POST['act']) and $_POST['act'] == 'editar_formulario') {
//var_dump($_POST);
$formulario = new formulario();
$formulario->editar_formulario($_POST['cod_formulario']);
示例14: sql
<?php
//print_r($_GET);
session_start();
include "php.php";
if (isset($_GET['baixa']) and isset($_GET['cod_captacao']) and $_GET['baixa'] != '' and $_GET['cod_captacao'] != '') {
// $select= "DELETE FROM `".$schema."`.`captacao_cartas_baixas` WHERE `captacao_cartas_baixas`.`cod_captacao_cartas_baixas` = ".$cod_captacao_cartas_baixas.";";
$sql = new sql();
$sql->delete('captacao_cartas_baixas', " cod_captacao_cartas_baixas= " . $_GET['baixa'] . " and cod_captacao_cartas=" . $_GET['cod_captacao']);
$sql->update('captacao_cartas', " status='-02' ", " cod_captacao_cartas=" . $_GET['cod_captacao']);
// $sql->baixar_captacao('00',$_GET['data_baixa'],$_GET['valor_baixa'],$_GET['cod_captacao_cartas'],$_GET['cod_carteira'],"","","BAIXA MANUAL");
}
header("Location:../cadastro_captacoes.php?id=" . $_GET['cod_captacao'] . "");
示例15: sql
function upload_logo()
{
$sql = new sql();
//move arquivo
$arquivo = $_FILES['upload_logo'];
//Salvando o Arquivo
$nome_arquivo = md5(mt_rand(1, 10000) . $arquivo['name']) . '.jpg';
$caminho_arquivo = "imagens/";
$caminho = $caminho_arquivo . $nome_arquivo;
move_uploaded_file($arquivo['tmp_name'], "../" . $caminho);
$table = "cad_empresa";
$campos = "`logo`='" . $caminho . "'";
$where = "cod_empresa='" . $_POST['cod_empresa'] . "'";
$msg = "N";
$sql->update($table, $campos, $where, $msg);
echo "<img src='" . $caminho . "' class='uk-cover-background' alt='' height='100' width='200'>";
}