当前位置: 首页>>代码示例>>PHP>>正文


PHP updateTable函数代码示例

本文整理汇总了PHP中updateTable函数的典型用法代码示例。如果您正苦于以下问题:PHP updateTable函数的具体用法?PHP updateTable怎么用?PHP updateTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了updateTable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: markReferralAsExchanged

 public static function markReferralAsExchanged($userId)
 {
     if ($userId == null) {
         return false;
     }
     $creditIds = self::checkAvailableReferral($userId);
     if ($creditIds == false) {
         return false;
     }
     $result = updateTable(self::REFERRALS_TABLE, 'exchange_date = \'' . date('Y-m-d H:i:s') . '\', exchanged = true', 'id IN(' . implode(',', $creditIds) . ')');
     return $result;
 }
开发者ID:narbelys,项目名称:fototea,代码行数:12,代码来源:Referral.php

示例2: validaSession

<?php

include "connect/database.php";
validaSession();
securityValidation($_COOKIE['id'], "20");
if ($_POST) {
    $we = "value = '" . $_POST['price'] . "'";
    updateTable("varios", $we, "id = 1");
}
$varios = listAll("varios", "WHERE id = 1");
$rs_var = mysql_fetch_object($varios);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Envio | Vaodesign</title>
<link rel="stylesheet" href="css/style.css" type="text/css" />
<!--[if IE 9]>
    <link rel="stylesheet" media="screen" href="css/ie9.css"/>
<![endif]-->

<!--[if IE 8]>
    <link rel="stylesheet" media="screen" href="css/ie8.css"/>
<![endif]-->

<!--[if IE 7]>
    <link rel="stylesheet" media="screen" href="css/ie7.css"/>
<![endif]-->
<script type="text/javascript" src="js/plugins/jquery-1.7.min.js"></script>
开发者ID:narbelys,项目名称:fototea,代码行数:31,代码来源:envio.php

示例3: updateTable

<?php

include "functions.php";
if (isset($_POST['submit3']) && isset($_POST['answer3'])) {
    $answer3 = $_POST['answer3'];
    updateTable('3', 'answer3');
    if ($answer3 === "Yes") {
        header('Location: doubleConsult.php');
    } elseif ($answer3 === "No") {
        header('Location: question4.php');
    } else {
        echo "error";
    }
}
?>

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    <link rel="stylesheet" href="style.css">
</head>
<body>

<form action="question3.php" name="Questionnaire" method="post" class="col-md-6 col-md-offset-4">
    <h1>PACT</h1>
    <p id="q1">Is it the first appointment of the patient?</p>
    <input class="answers" value="No" name="answer1">
    <p id="q2">How many complaints does the patient have?</p>
开发者ID:EsthervdG,项目名称:PACT,代码行数:31,代码来源:question3.php

示例4: mysql_query

             // a realizar nuestro proceso ya sea de login o registro.
             $user = $fbme['email'];
             $query_login = mysql_query("SELECT * FROM user WHERE user = '" . $user . "'");
             $num_login = mysql_num_rows($query_login);
             if ($num_login < 1) {
                 $login_resp = 'window.location="registroFacebook";';
             } else {
                 $rs_user = mysql_fetch_object($query_login);
                 $name = $rs_user->name . " " . $rs_user->lastname;
                 $login_date = explode("-", $rs_user->last_login);
                 if ($login_date[0] == "0000") {
                     $login_resp = 'window.location="completarPerfil";';
                     setcookie("user", $name, 0);
                     setcookie("id", $rs_user->id, 0);
                 } else {
                     updateTable("user", "last_login=NOW()", "id={$rs_user->id}");
                     $login_resp = 'window.location="perfil";';
                     setcookie("user", $name, 0);
                     setcookie("id", $rs_user->id, 0);
                 }
             }
             echo "<script>" . $login_resp . "</script>";
         }
     }
 }
 if ($_POST) {
     $user_user = $_REQUEST['user_user'];
     $user_pass = $_REQUEST['user_password'];
     $login = login($user_user, $user_pass);
     if ($login == false) {
         $app->addError("La combinación de Correo y Contrase&ntilde;a son incorrectos.");
开发者ID:narbelys,项目名称:fototea,代码行数:31,代码来源:index.php

示例5: updateTable

                $fileNameUnique = $fileName . "_" . $photo_id . "." . $extension;
                updateTable("albumes_det", "ad_url = '" . $fileNameUnique . "'", "ad_id = " . $photo_id);
                $pathFile = '../profiles/' . $perfilSha1 . '/' . $albumSha1 . '/' . $fileNameUnique;
                move_uploaded_file($file['tmp_name'], $pathFile);
                // Event: Fotos subidas álbumes
                $events = FAnalytics::getInstance();
                $events->trackEvent('Album - Fotos subidas', 'Foto subida al album ' . $albumId, $user->id);
                return 'success';
            } else {
                return 'error';
            }
        }
        if ($act == "principalFoto") {
            $foto = $_REQUEST['ad_id'];
            updateTable("albumes_det", "ad_is_principal = false", "ad_a_id = '{$_REQUEST['album']}'");
            updateTable("albumes_det", "ad_is_principal = true", "ad_a_id = '{$_REQUEST['album']}' AND ad_id = '{$foto}'");
        }
    }
    if ($act == "buscarFoto") {
        $foto = $_REQUEST['foto'];
        $limit = $foto - 1;
        $foto = listAll("albumes_det", "WHERE ad_a_id = '{$_REQUEST['a_id']}' AND ad_status='S' LIMIT {$limit},{$foto}");
        $rs_foto = mysql_fetch_object($foto);
        $url_img = "profiles/" . sha1($rs_foto->ad_user_id) . "/" . sha1($rs_foto->ad_a_id) . "/" . $rs_foto->ad_url;
        $fecha = explode(" ", dateField($rs_foto->ad_cdate));
        $desc = $fecha[0];
        $arreglo[] = array('img' => $url_img, 'desc' => $desc);
        echo json_encode($arreglo);
    }
} else {
    $app->redirect($app->getConfig()->getUrl('perfil'));
开发者ID:narbelys,项目名称:fototea,代码行数:31,代码来源:albumAction.php

示例6: isset

<?php

require "../include/init/init.php";
$id = isset($_GET["id"]) ? (int) $_GET["id"] : 1;
// 查询数据
$dataselect = editTable("SELECT * FROM jl_document WHERE document_id={$id}");
if ($_POST) {
    $name = trim($_POST["name"]) ? $_POST["name"] : "";
    $content = trim($_POST["content"]) ? $_POST["content"] : "";
    updateTable("UPDATE jl_document SET \n      document_name='{$name}',\n      document_content='{$content}' WHERE document_id={$id}", "./document.php");
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" href="">
  <title>金陵后台管理</title>
  <link href="../css/bootstrap.min.css" rel="stylesheet">
  <link href="../css/dashboard.css" rel="stylesheet">
</head>
<body>
  <?php 
require "../include/admin_header.php";
?>
  <div class="col-sm-12 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <!-- 更改即可 -->
开发者ID:Jeffery-Cai,项目名称:jinlingV1-1,代码行数:31,代码来源:document_edit.php

示例7: isset

<?php

require "../include/init/init.php";
$id = isset($_GET["id"]) ? (int) $_GET["id"] : 1;
// 查询数据
$dataselect = editTable("SELECT * FROM jl_friend WHERE friend_id={$id}");
if ($_POST) {
    $name = trim($_POST["name"]) ? $_POST["name"] : "";
    $link = trim($_POST["link"]) ? $_POST["link"] : "";
    updateTable("UPDATE jl_friend SET \r\n      friend_name='{$name}',\r\n      friend_link='{$link}' WHERE friend_id={$id}", "./friend.php");
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" href="">
  <title>金陵后台管理</title>
  <link href="../css/bootstrap.min.css" rel="stylesheet">
  <link href="../css/dashboard.css" rel="stylesheet">
</head>
<body>
  <?php 
require "../include/admin_header.php";
?>
  <div class="col-sm-12 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <!-- 更改即可 -->
开发者ID:Jeffery-Cai,项目名称:taiyi-smarty,代码行数:31,代码来源:friend_edit.php

示例8: select_row

<?php

require "../include/init/init.php";
$optiondata = select_row("SELECT * FROM jl_option");
// 修改数据
if ($_POST) {
    $keyword = $_POST["keyword"];
    $description = $_POST["description"];
    $address = $_POST["address"];
    $contact = $_POST["contact"];
    $copyright = $_POST["copyright"];
    updateTable("UPDATE `jl_option` SET `keyword`='{$keyword}',`description`='{$description}',`address`='{$address}',`contact`='{$contact}',`copyright`='{$copyright}'", "./option.php");
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" href="">
  <title>金陵后台管理</title>
  <link href="../css/bootstrap.min.css" rel="stylesheet">
  <link href="../css/dashboard.css" rel="stylesheet">
</head>
<body>
  <?php 
require "../include/admin_header.php";
?>
开发者ID:Jeffery-Cai,项目名称:jinlingV1-1,代码行数:31,代码来源:option.php

示例9: header

         $_SESSION["lastpage"] = "index.php";
     } else {
         $_SESSION["message"] = "Delete failed";
         $_SESSION["message"] = "edit.php";
     }
     $_SESSION['loggedin'] = 'FALSE';
     $_SESSION['message'] = "Account Successfully Deleted!";
     header("Location: messages.php");
     break;
 case 'edit':
     header("Location: edit.php");
     break;
     //submits the users edit to the database and sets new session variables.
 //submits the users edit to the database and sets new session variables.
 case 'editted':
     $success = updateTable('customers', $_REQUEST, 'CustomerId');
     $success ? $_SESSION["message"] = "Update Successful!" : ($_SESSION["message"] = "Update Failed!");
     $success ? $_SESSION["lastpage"] = "index.php" : ($_SESSION["lastpage"] = "edit.php");
     $success ? $_SESSION["userfirstname"] = $_POST['CustFirstName'] : $_POST['CustFirstName'];
     $success ? $_SESSION["userlastname"] = $_POST['CustLastName'] : $_POST['CustLastName'];
     print "<br /><br /><br /><br />";
     print $success;
     header("Location: messages.php");
     break;
     //submits the users account to the database and sets session variables.
 //submits the users account to the database and sets session variables.
 case 'Register':
     $customer = new Customer("null", $_REQUEST["CustFirstName"], $_REQUEST["CustLastName"], $_REQUEST["CustAddress"], $_REQUEST["CustCity"], $_REQUEST["CustProv"], $_REQUEST["CustPostal"], $_REQUEST["CustCountry"], $_REQUEST["CustHomePhone"], $_REQUEST["CustBusPhone"], $_REQUEST["CustEmail"], 0, $_REQUEST["CustUsername"], $_REQUEST["CustPassword"]);
     if ($customer->customerAdd()) {
         #The user will be redirected to the index page if they've been added to the database.
         $_SESSION["loggedin"] = "TRUE";
开发者ID:Vekto,项目名称:OOSDProject1,代码行数:31,代码来源:reghandler.php

示例10: isset

 */
require "../include/inic.php";
// 接收url参数
$id = isset($_GET["id"]) ? (int) $_GET["id"] : 0;
$id_data = editTable("SELECT * FROM wd_case WHERE case_id={$id}");
if ($_POST) {
    $caseName = $_POST["caseName"];
    $caseLink = $_POST["caseLink"];
    $caseDescription = $_POST["caseDescription"];
    $caseTime = strtotime($_POST["caseTime"]);
    if ($_FILES) {
        upload_file("caseFileImg");
        $caseFileImg = $_FILES["caseFileImg"]["name"];
    }
    //插入sql语句
    updateTable("UPDATE `wd_case` SET \n\t\t`case_title`='{$caseName}',\n\t\t`case_link`='{$caseLink}',\n\t\t`case_add_time`='{$caseTime}',\n\t\t`case_img_url`='{$caseFileImg}',\n\t\t`case_description`='{$caseDescription}' WHERE case_id={$id}", "./products.php");
}
?>
<!doctype html>
<html lang="zh-ch">
	<!-- container-fluid -->
	<head>
		<title>文豆-后台管理</title>
		<meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="; charset=utf-8" />
		<link rel="stylesheet" href="bootstrap.min.css" />
		<link rel="stylesheet" href="../css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="../css/unicorn.main.css" />
		<link rel="stylesheet" href="../css/uniform.css" />
		<link rel="stylesheet" href="../css/unicorn.grey.css" class="skin-color" />
开发者ID:Jeffery-Cai,项目名称:wengdoV1-2,代码行数:31,代码来源:products_add_edit.php

示例11: loginFb

function loginFb($user)
{
    $query_login = mysql_query("SELECT * FROM user WHERE user = '" . $user . "'");
    $num_login = mysql_num_rows($query_login);
    if ($num_login < 1) {
        $login_resp = 'window.location="../login";';
        return $login_resp;
    } else {
        $rs_user = mysql_fetch_object($query_login);
        $name = $rs_user->name . " " . $rs_user->lastname;
        setcookie("user", $name, 0);
        setcookie("id", $rs_user->id, 0);
        $login_date = explode("-", $rs_user->last_login);
        if ($login_date[0] == "0000") {
            $login_resp = 'window.location="../completarPerfil";';
            return $login_resp;
        } else {
            updateTable("user", "last_login=NOW()", "id={$rs_user->id}");
            $login_resp = 'window.location="../miHome";';
            return $login_resp;
        }
    }
}
开发者ID:narbelys,项目名称:fototea,代码行数:23,代码来源:libSM.php

示例12: updateTable

    $tel = $_REQUEST['phone'];
    $movil = $_REQUEST['mobile'];
    $city = $_REQUEST['city'];
    $id_user = $_GET['i'];
    $user_data = updateTable("user", "name = '{$name}',lastname= '{$lastname}',dob='{$dob}',act='{$user_act}',gender='{$gender}'", "id = '{$_GET['i']}'");
    updateTable("user_det", "description = '{$desc}'", "id_user = '{$id_user}' AND id_data = '2'");
    updateTable("user_det", "description = '{$direccion}'", "id_user = '{$id_user}' AND id_data = '3'");
    updateTable("user_det", "description = '{$cp}'", "id_user = '{$id_user}' AND id_data = '4'");
    updateTable("user_det", "description = '{$pais}'", "id_user = '{$id_user}' AND id_data = '5'");
    updateTable("user_det", "description = '{$tel}'", "id_user = '{$id_user}' AND id_data = '6'");
    updateTable("user_det", "description = '{$city}'", "id_user = '{$id_user}' AND id_data = '10'");
    $md = getUserData($id_user, "7");
    if (empty($md)) {
        insertTable("user_det", "'',{$id_user},'7','{$movil}'");
    } else {
        updateTable("user_det", "description = '{$movil}'", "id_user = '{$id_user}' AND id_data = '7'");
    }
    if ($user_data != false) {
        ?>
<script>
	alert("Se ha modificado el usuario correctamente.");
	window.location="usuarios.php";
	</script>
    <?php 
    } else {
        ?>
    <script>
	alert("No se ha  podido modificar el usuario correctamente.");
	window.history.back();
	</script>
    <?php 
开发者ID:narbelys,项目名称:fototea,代码行数:31,代码来源:usuarios-editar.php

示例13: foreach

    $mySqlStmt = "Delete From " . $inTableName;
    $mySqlStmt .= " Where ";
    foreach ($myKeys as $myKey) {
        $myDataValue = $inRowNode->xpath($myKey);
        $mySqlStmt .= $mySep . $myKey . " = '" . $myDataValue[0] . "'";
        $mySep = " AND ";
    }
    $result = mysql_query($mySqlStmt);
    if (mysql_error()) {
        printf("\n Errors detected on update %s ", mysql_error());
        return false;
    } else {
        printf("\n Delete successful %d ", $result);
        mysql_info();
        return true;
    }
}
/* ****************************************
Get input stream
**************************************** */
$xml = file_get_contents('php://input');
$xmlDoc = simplexml_load_string($xml);
/* ****************************************
Process input requests
**************************************** */
echo "\n------------------------------";
$myTables = $xmlDoc->xpath('//Table');
foreach ($myTables as $myTable) {
    updateTable($myTable);
}
include_once "WfwTerm.php";
开发者ID:WaterskiScoring,项目名称:LiveWebScoring,代码行数:31,代码来源:WfwImport.php

示例14: isset

/**
 * wengdo后台添加导航
 * author: Jeffery
 * create time: 2015-09-08
 */
require "../include/inic.php";
$id = isset($_GET["id"]) ? (int) $_GET["id"] : 0;
$id_data = editTable("SELECT * FROM wd_nav WHERE nav_id={$id}");
// 表单接收
if ($_POST) {
    $navName = $_POST["navName"];
    $navLink = $_POST["navLink"];
    $nav_pid = $_POST["nav_pid"];
    // 修改sql语句
    updateTable("UPDATE `wd_nav` SET \n\t\t`nav_name`='{$navName}',\n\t\t`nav_pid`='{$navLink}',\n\t\t`nav_links`='{$nav_pid}' WHERE nav_id={$id}", "./nav.php");
}
$navpiddata = selectDb("SELECT * FROM wd_nav WHERE nav_pid=0");
// var_dump($id_data);
?>
	

<!doctype html>
<html lang="zh-ch">
	<!-- container-fluid -->
	<head>
		<title>文豆-后台管理</title>
		<meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="; charset=utf-8" />
		<link rel="stylesheet" href="bootstrap.min.css" />
开发者ID:Jeffery-Cai,项目名称:wengdoV1-2,代码行数:30,代码来源:nav_add_edit.php

示例15: userAccoutUpdate

function userAccoutUpdate($user_code, $data)
{
    $condition["user_code"] = $user_code;
    // 更新用户基本信息表(追加数据)
    if (updateTable(TB_BAS_USER_ACCOUT, $data, $condition, 'add')) {
        return true;
    } else {
        return false;
    }
}
开发者ID:ReadYun,项目名称:vixik,代码行数:10,代码来源:userFunc.php


注:本文中的updateTable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。