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


PHP updateData函数代码示例

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


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

示例1: postRecord

function postRecord($userID, $date)
{
    global $DBConnArray;
    $sql = "insert into invoices values (" . $userID . ", '" . $date . "', " . "12.49);";
    $returnArray = updateData($DBConnArray, $sql);
    if (!$returnArray['ErrorReturn']['Success']) {
        echo json_encode(array('table' => $DBConnArray['ErrorReturn']['ErrorMessage']));
        return;
    }
}
开发者ID:EfraimKrug,项目名称:Canneur,代码行数:10,代码来源:postInvoices.php

示例2: signupOverride

function signupOverride($coreUserInfo)
{
    global $gasDatabaseName, $CoreUserTableName;
    $insert = array();
    $uid = $coreUserInfo["Result"]["Uid"];
    $insert["EmployeeName"] = post("EmployeeUserName");
    $insert["StoreName"] = post("StoreName");
    $_POST = null;
    connectDB($gasDatabaseName);
    //    insertData("Employee", $insert);
    updateData("{$CoreUserTableName}", "Uid = '{$uid}'", $insert);
    printResultByMessage("", 0);
}
开发者ID:qichangjun,项目名称:HTMLLearn,代码行数:13,代码来源:function.php

示例3: edit

/**
* Author : Jan Germann
* Datum : 02.05.2010
* Modul : menu
* Beschreibung : Bearbeiten von einem Menüpunkt
*/
function edit()
{
    global $msg, $mysql;
    //Keine Menüpunkte vorhande? Dann Abbrechen mit Fehler!
    if (!mysql_result($mysql->query("SELECT count(*) FROM " . _PREFIX_ . "menu"), 0)) {
        $msg->error("Es sind keine Menüpunkte vorhanden.");
        return;
    }
    if (!isset($_POST['choose']) && !isset($_POST['edit'])) {
        return chooseMenu();
    } elseif (isset($_POST['choose'])) {
        return showFormEdit();
    } elseif (isset($_POST['edit'])) {
        return updateData();
    }
}
开发者ID:nubix,项目名称:cms,代码行数:22,代码来源:function.edit.php

示例4: addData

function addData($parts, $data)
{
    switch ($parts[0]) {
        case "season":
            //header('Content-Type: application/json');
            $cmd = [0 => "all"];
            $current = getData($cmd);
            $new = json_decode($data);
            $seasons = [0 => "none", 1 => "autumn", 2 => "winter", 3 => "spring", 4 => "summer"];
            $oldseasonname = $current->season_name;
            $seasonid = $current->season;
            $name = explode(" ", $oldseasonname);
            $file = '../data/archive/' . $name[1] . '_' . $seasons[$seasonid] . '_archive.json';
            $fh = fopen($file, 'w') or die("Error: Can't open file.");
            fwrite($fh, json_encode($current));
            fclose($fh);
            updateData([0 => "all"], $new);
            break;
    }
}
开发者ID:purplesquirrels,项目名称:bball-scorecard,代码行数:20,代码来源:api.php

示例5: header

    $_SESSION['returnArray'] = $DBConnArray['ErrorReturn']['ErrorMessage'];
    header("Location: " . $_SERVER['HTTP_REFERER']);
    return;
}
$sql = "SELECT * from users as u, payments as p\n\t\tWHERE p.owner_id = u.id \n\t\tAND   u.email_address = '" . $postArray['email'] . "';";
$checkArray = getDataSet($DBConnArray, $sql);
if (!$DBConnArray['ErrorReturn']['Success']) {
    $_SESSION['returnArray'] = $DBConnArray['ErrorReturn']['ErrorMessage'];
    header("Location: " . $_SERVER['HTTP_REFERER']);
    return;
}
if (empty($checkArray['DataSet'])) {
    $_SESSION['returnArray'] = "You can not critique your canner if you have never paid";
    header("Location: " . $_SERVER['HTTP_REFERER']);
    return;
}
#
# Select info from temp_users table
# Update password from current form
# Copy to users record
# Insert record into users table...
#
#$postArray['email'] = 'nancybn18@gmail.com';
$sql = "SELECT c.* FROM canners as c, owners as o, users as u \n\t\tWHERE c.user_id = o.canner_id \n\t\tAND o.user_id = u.id \n\t\tAND u.email_address = '" . $postArray['email'] . "';";
$cannerArray = getDataSet($DBConnArray, $sql);
$sql = "INSERT INTO canner_ratings (user_id, rating, notes) \n\t\tVALUES (" . $cannerArray['DataSet'][0]['user_id'] . "," . $postArray['rating'] . ",\"" . preg_replace("/\"/", "'", $postArray['notes']) . "\");";
$cannerArray = updateData($DBConnArray, $sql);
header('Location:' . $baseURL . 'index.html');
?>
 
开发者ID:EfraimKrug,项目名称:Canneur,代码行数:29,代码来源:setRating.php

示例6: updateData

<meta charset="utf-8">
<?php 
include "connect.php";
$id = $_GET['id'];
if (isset($_POST["GÜNCELLE"])) {
    updateData($id);
    header("location:index.php");
}
$users = getData();
foreach ($users as $row) {
    ?>
		<form action="index.php" method="POST" enctype="multipart/form-data">
  	<h1 style="color:gray; ">Müşteri Ekle </h1>
    <table >
    	<tr>
    		<td><img src="<?php 
    echo $row['image_200_200'];
    ?>
" alt=""></td>
    	</tr>
      <tr>
        <td><input type="text" style="padding:5px; " name="ad" id="ad" value="<?php 
    echo $row['ad'];
    ?>
" required></td>
      </tr>
      <tr>
        <td><input type="text" style="padding:5px;" name="soyad" id="soyad" value="<?php 
    echo $row['soyad'];
    ?>
" required></td>
开发者ID:kevsersrca,项目名称:4-User-Management-With-Avatars,代码行数:31,代码来源:update.php

示例7: saveData

<?php

if (isset($_POST['submit'])) {
    saveData() ? add_media_slider() : media_slider_details();
} elseif (isset($_POST['edit'])) {
    updateData() ? add_media_slider() : media_slider_details();
} elseif ($_GET['action'] == 'edit') {
    add_media_slider();
} elseif ($_GET['action'] == 'add') {
    add_media_slider();
} elseif ($_GET['action'] == 'delete') {
    delete_slider($_GET['id']);
    media_slider_details();
} else {
    media_slider_details();
}
function delete_slider($id)
{
    global $wpdb;
    $table_name = $wpdb->prefix . "media_sliders";
    $slider_image = $wpdb->get_row("select * from {$table_name} where id='" . $id . "';");
    $wpdb->delete($table_name, array('ID' => $id));
    $file_path = ABSPATH . "wp-content/uploads/";
    $file_path1 = ABSPATH . "wp-content/uploads/resize/";
    for ($i = 1; $i <= 8; $i++) {
        $image = "image" . $i;
        $file_name = $file_path . $slider_image->{$image};
        $file_name1 = $file_path1 . $slider_image->{$image};
        unlink($file_name);
        unlink($file_name1);
    }
开发者ID:swapnildahiphale,项目名称:wordpress,代码行数:31,代码来源:media_slider.php

示例8: header

<?php 
require_once "functions.php";
if (!isset($_SESSION["logged_in_user_id"])) {
    header("Location: login.php");
}
// kas kustutame
// ?delete=vastav id mida kustutada on aadressireal
if (isset($_GET["delete"])) {
    echo "Kustutame id " . $_GET["delete"];
    //kaivitan funktsiooni, saadan kaasa id!
    deleteData($_GET["delete"]);
}
//salvestan andmebaasi uuendused
if (isset($_POST["save"])) {
    var_dump($_POST);
    updateData($_POST["register_id"], $_POST["name"], $_POST["address"], $_POST["phone_number"], $_POST["register_code"]);
}
$keywod = "";
//aadressireal on keyword
if (isset($_GET["keyword"])) {
    //otsin
    $keyword = $_GET["keyword"];
    $array_of_data = getData($keyword);
} else {
    //kusin koik andmed
    //kaivitan funktsiooni
    $array_of_data = getData();
}
?>

<h2>Tabel</h2>
开发者ID:RuziGg,项目名称:eksam,代码行数:31,代码来源:register.php

示例9: connect

 /**
  * Connect (create a socket) to the WhatsApp network.
  */
 public function connect()
 {
     //If we have already connected AND the socket has not been closed from the remote side - then
     //no need to connect again.
     //WARNING: Lots of bugs in PHP's detection of socket timeout/remote disconnect. Be careful changing this code.
     //http://ie2.php.net/manual/en/function.socket-read.php#115903
     //https://bugs.php.net/bug.php?id=47918
     //http://stackoverflow.com/questions/20334366/php-fsockopen-how-to-know-if-connection-is-alive
     if ($this->isConnected()) {
         return true;
     }
     $WAver = trim(file_get_contents($this->WHATSAPP_VER_CHECKER));
     $WAverS = str_replace(".", "", $WAver);
     $ver = str_replace(".", "", $this->WHATSAPP_VER);
     if ($ver < $WAverS) {
         $classesMD5 = file_get_contents('https://coderus.openrepos.net/whitesoft/whatsapp_classes');
         updateData('token.php', $WAver, $classesMD5);
         updateData('whatsprot.class.php', $WAver);
     }
     $Socket = fsockopen($this->WHATSAPP_HOST, $this->PORT);
     if ($Socket !== false) {
         stream_set_timeout($Socket, $this->TIMEOUT_SEC, $this->TIMEOUT_USEC);
         $this->socket = $Socket;
         $this->eventManager()->fire("onConnect", array($this->phoneNumber, $this->socket));
     } else {
         if ($this->debug) {
             print_r("Firing onConnectError\n");
         }
         $this->eventManager()->fire("onConnectError", array($this->phoneNumber, $this->socket));
     }
 }
开发者ID:sangupandi,项目名称:WhatsAPI-Official,代码行数:34,代码来源:whatsprot.class.php

示例10: trim

}

if ($action == "update")
{
  
  $NewFName    = trim($_POST['FName']);
  $NewLName    = trim($_POST['LName']);
  $NewMName    = trim($_POST['MName']);
  $NewAddress1 = trim($_POST['Address1']);
  $NewAddress2 = trim($_POST['Address2']);
  $NewCity     = trim($_POST['City']);
  $NewState    = trim($_POST['State']);
  $NewZip      = trim($_POST['Zip']);
  $NewPhone1   = trim($_POST['Phone1']);
  $NewPhone2   = trim($_POST['Phone2']);
  $NewEmail    = trim($_POST['Email']);
  $NewUsername = trim($_POST['Username']);

  if (updateData($CustomerID, $FName, $NewFName, $LName, $NewLName, $MName, $NewMName, $Address1, $NewAddress1, $Address2, $NewAddress2, $City, $NewCity, $State, $NewState, $Zip, $NewZip, $Phone1, $NewPhone1, $Phone2, $NewPhone2, $Email, $NewEmail, $Username, $NewUsername, $dblogin, $dbpass, $database))
  {
    generateGenericLayout($dblogin, $dbpass, $db, "<B>Account Settings</B>");
    beginContentBox();
    displayAccountInfo($CustomerID, $FName, $LName, $MName, $Address1,
                       $Address2, $City, $State, $Zip, $Phone1, $Phone2,
                       $Email, $Username, "");  
    endContentBox();
  }
  exit;
}

?>
开发者ID:ashlux,项目名称:dci-ticket-purchasing,代码行数:31,代码来源:account.php

示例11: setTxt

 public function setTxt($conn, $text)
 {
     $this->text = $text;
     updateData($conn, "solutions", "text", $text, "context_id", $this->getId());
 }
开发者ID:Chaos-TIS,项目名称:letna-liga,代码行数:5,代码来源:Solution.php

示例12: isset

<?php

include_once '../utiliti/crud_function.php';
#input ke log
$id = isset($_GET['id']) ? $_GET['id'] : null;
$array_obj = array('id_log' => '', 'id_calon' => $id);
insertData($array_obj, 'log', $conn);
# Update data calon yang sudah memilih
$id_voter = $_SESSION['no_aktv'];
$array_obj2 = array('status' => 'sudah memilih');
updateData($array_obj2, 'voter', $id_voter, 'no_aktivasi', $conn);
#unset nomor aktv
unset($_SESSION['no_aktv']);
?>

<h1 align="center"> TERIMA KASIH SUDAH MENGGUNAKAN HAK PILIH</h1>
<h2 align="center">SILAHKAN TINGGALKAN BILIK SUARA DAN PASTIKAN TIDAK ADA YANG TERTINGGAL</h2>
开发者ID:PanduAldi,项目名称:evotingamik,代码行数:17,代码来源:selesai.php

示例13: getFirstData

<?php

require_once "functions.php";
$array_of_names = getFirstData();
if (isset($_POST["save"])) {
    updateData($_POST["id"], $_POST["carved"], 0, 0);
}
?>


<h2>Tabel</h2>
<table border=1>
	<tr>
		<th>id</th>
		<th>Nimi</th>
		<th>Treitud</th>
		<th>Edit</th>
	</tr>
	
	<?php 
//var_dump($array_of_names);
for ($i = 0; $i < count($array_of_names); $i++) {
    //echo $array_of_names[$i]->id;
    if (isset($_GET["edit"]) && $array_of_names[$i]->id == $_GET["edit"]) {
        echo "<tr>";
        echo "<form action= 'tabel1.php' method='post'>";
        echo "<input type='hidden' name='id' value='" . $array_of_names[$i]->id . "'>";
        echo "<td>" . $array_of_names[$i]->id . "</td>";
        echo "<td>" . $array_of_names[$i]->name . "</td>";
        echo "<td><input name='carved' value='" . $array_of_names[$i]->carved . "'></td>";
        echo "<td><a href='tabel1.php'>cancel<a></td>";
开发者ID:jormkop,项目名称:eksam-php,代码行数:31,代码来源:tabel1.php

示例14: insertData

        $data = insertData('devices', $insert_data);
        $devices_ID = mysql_insert_id();
    } else {
        $where = array('user_id' => $user_ID);
        $data = updateData('devices', $insert_data, $where);
        $devices_ID = $devices_row[0];
    }
    if ($data) {
        $activity_data = array('user_id' => $user_ID, 'device_id' => $devices_ID, 'activity_type' => '', 'activity_notes' => $note, 'activity_date' => date("Y-m-d"));
        $activity_row = getRow("SELECT * FROM `activity_log` WHERE `user_id` ='{$user_ID}'");
        if ($activity_row == null) {
            insertData('activity_log', $activity_data);
            echo "<h3 class='success-msg'>Device Added Successfully.</h3>";
        } else {
            $where = array('user_id' => $user_ID);
            $data = updateData('activity_log', $activity_data, $where);
            echo "<h3 class='success-msg'>Device Updated Successfully.</h3>";
        }
    }
}
if (!empty($_SESSION['user_id'])) {
    $user_data = get_user_data($_SESSION['user_id']);
    $name = $user_data->f_name . ' ' . $user_data->l_name;
    if ($device_data = get_device_data($_SESSION['user_id'])) {
        $purchase_date = $device_data->purchase_date ? $device_data->purchase_date : '';
        $price = $device_data->price ? $device_data->price : '';
        $imei = $device_data->imei_string ? $device_data->imei_string : '';
        $serial = $device_data->serial_num ? $device_data->serial_num : '';
        $phone = $device_data->phone_num ? $device_data->phone_num : '';
        $purchaser = $device_data->purchaser ? $device_data->purchaser : '';
        $model = $device_data->model ? $device_data->model : '';
开发者ID:shivamanhar,项目名称:phpMDM,代码行数:31,代码来源:add_device.php

示例15: updateInvoices

function updateInvoices($params)
{
    global $DBConnArray;
    $userID = $params['userID'];
    $userEmail = $params['email'];
    $userFName = $params['fname'];
    $userLName = $params['lname'];
    $paymentAmount = $params['amount'];
    $paymentDateArray = $params['dates'];
    $date = date("Y-m-d");
    #echo "<br>" . $userEmail;
    #echo "<br>" . $userFName . " " . $userLName;
    #echo "<br>" . $paymentAmount;
    #echo "<br>" . print_r($paymentDateArray, true);
    foreach ($paymentDateArray as $invDate) {
        $sql = "SELECT * FROM invoices WHERE owner_id = " . $userID . " AND service_date = '" . $invDate . "';";
        $invoiceData = getDataSet($DBConnArray, $sql);
        if ($paymentAmount >= $invoiceData['DataSet'][0]['amount']) {
            $paymentAmount -= $invoiceData['DataSet'][0]['amount'];
            $sql = "UPDATE invoices SET paid = 'Y', " . " invoice_date ='" . $date . "' WHERE owner_id  = " . $userID . " AND service_date = '" . $invDate . "';";
            $returnArray = updateData($DBConnArray, $sql);
        } else {
            $paymentAmount = 0;
            $sql = "UPDATE invoices SET paid = 'P', " . " invoice_date ='" . $date . "' WHERE owner_id  = " . $userID . " AND service_date = '" . $invDate . "';";
            $returnArray = updateData($DBConnArray, $sql);
        }
    }
    return array('success' => true);
}
开发者ID:EfraimKrug,项目名称:Canneur,代码行数:29,代码来源:payInvoice.php


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