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


PHP BD::update方法代码示例

本文整理汇总了PHP中BD::update方法的典型用法代码示例。如果您正苦于以下问题:PHP BD::update方法的具体用法?PHP BD::update怎么用?PHP BD::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BD的用法示例。


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

示例1: addRepMessage

function addRepMessage($com, $id)
{
    $Messagerie = new Messagerie();
    $BD = new BD('messagerie');
    $BD->update("luAuteur", 1, "idmessage", $id);
    $BD->update("luDestinataire", 1, "idmessage", $id);
    $BD->update("timestamp", time(), "idmessage", $id);
    $userMessage = $Messagerie->recupUser($_SESSION['iduser']);
    $message = $Messagerie->infoConvers($_GET['id']);
    $msg = '<div class="line3 frame white2">
			<img class="avatar-com" src="' . $userMessage->avatar . '" alt="default">
			<div class="inline-block vt-top">
				<p class="line2">
					<a class="txt-dec-none c-black1" href="index.php?page=profil&amp;nom=' . $userMessage->pseudo . '"><strong>' . $userMessage->pseudo . '</strong></a>
					, le <i>' . date('d/m/y H:i', time()) . '</i>
				</p>
				<div class="line2">
					<p>' . $com . '</p>
				</div>
			</div>
		</div><!-- .frame -->';
    $fp = fopen(Config::$path['messagerie'] . $message->link . $message->idauteur . $message->iddestinataire . '.msg', "r+");
    $contenu_message = '';
    while (($buffer = fgets($fp, 4096)) !== false) {
        $contenu_message .= $buffer;
    }
    fwrite($fp, $msg);
    fclose($fp);
}
开发者ID:sebspas,项目名称:AFK-WEB,代码行数:29,代码来源:readMessage.php

示例2: updateUser

function updateUser($pseudo, $nom, $prenom, $email)
{
    $BD = new BD('user');
    $BD->update('pseudo', $pseudo, 'iduser', $_SESSION['iduser']);
    $BD->update('nom', $nom, 'iduser', $_SESSION['iduser']);
    $BD->update('prenom', $prenom, 'iduser', $_SESSION['iduser']);
    $BD->update('mail', $email, 'iduser', $_SESSION['iduser']);
}
开发者ID:sebspas,项目名称:AFK-WEB,代码行数:8,代码来源:modifier.php

示例3: activation

function activation($Mail, $Tokens)
{
    $BD = new BD("user");
    $user = $BD->select("mail", $Mail);
    if ($user->tokens == $Tokens) {
        $BD->update("banni", 0, "iduser", $user->iduser);
        $BD->update("tokens", 0, "iduser", $user->iduser);
        return "ok";
    } else {
        return "Validation impossible ...";
    }
}
开发者ID:sebspas,项目名称:Share2Go,代码行数:12,代码来源:login.php

示例4: inscrit

function inscrit($Nom, $Prenom, $Age, $Sexe, $Pass, $Tel, $Mail, $Permis)
{
    $BD = new BD("user");
    $BD->addUser($Nom, $Prenom, $Age, $Sexe, $Pass, $Tel, $Mail, $Permis);
    $BD->update("banni", 1, "mail", $Mail);
    $token = uniqid(rand(), true);
    $token = sha1($token);
    $BD->update("tokens", $token, "mail", $Mail);
    $BD->update("avatar", "avatar/default.png", "mail", $Mail);
    $link = "http://62.210.110.24/S2go/dev/login.php?mail=" . $Mail . "&tok=" . $token;
    $mail = new mail($Mail, "Share2go : Validation de votre compte !", "Reservation", $link);
}
开发者ID:sebspas,项目名称:Share2Go,代码行数:12,代码来源:inscription.php

示例5: changepass

function changepass($Mail, $Tokens, $Pass)
{
    $BD = new BD("user");
    $user = $BD->select("mail", $Mail);
    if ($user->tokens == $Tokens) {
        $Pass2 = sha1($Pass);
        $BD->update("mdp", $Pass2, "iduser", $user->iduser);
        $BD->update("tokens", NULL, "iduser", $user->iduser);
        return "ok";
    } else {
        return "Changement impossible ...";
    }
}
开发者ID:sebspas,项目名称:Share2Go,代码行数:13,代码来源:changepass.php

示例6: updateTrajet

function updateTrajet($Date, $villedep, $villearr, $hdep, $prix, $place, $nocig, $music, $bag, $bavar, $com, $idvehicule, $oldtrajet)
{
    $BD = new BD('trajet');
    if ($oldtrajet->Date != $Date) {
        $BD->update("date", $Date, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->villedep != $villedep) {
        $BD->update("villedep", $villedep, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->villearr != $villearr) {
        $BD->update("villearr", $villearr, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->heuredep != $hdep) {
        $BD->update("heuredep", $hdep, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->prix != $prix) {
        $BD->update("prix", $prix, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->nbplace != $place) {
        $BD->update("nbplace", $place, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->nonfumeur != $nocig) {
        $BD->update("nonfumeur", $nocig, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->musique != $music) {
        $BD->update("musique", $music, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->valise != $bag) {
        $BD->update("valise", $bag, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->bavar != $bavar) {
        $BD->update("bavar", $bavar, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->com != $com) {
        $BD->update("com", $com, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->valise != $bag) {
        $BD->update("valise", $bag, "idtrajet", $oldtrajet->idtrajet);
    }
    if ($oldtrajet->idvehicule != $idvehicule) {
        $BD->update("idvehicule", $idvehicule, "idtrajet", $oldtrajet->idtrajet);
    }
}
开发者ID:sebspas,项目名称:Share2Go,代码行数:43,代码来源:modifier.php

示例7: json_encode

<?php

session_start();
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
require_once '../../app/Config.class.php';
require_once '../../app/Bd.class.php';
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
$return = array();
extract($_GET);
if (!isset($image) || !preg_match('/^http[s]?:\\/\\/[-a-zA-Z0-9_.]*\\/[-a-zA-Z0-9\\/_.]*\\.(jp[e]?g|png|gif)$/', $image)) {
    $return['error'] = "Url invalide";
} else {
    $img = get_headers($image, 1);
    if ($img['Content-Length'] > 356000) {
        $return['error'] = "Image trop lourde...300ko max";
    } else {
        $BD = new BD('user');
        $BD->update('avatar', $image, 'iduser', $_SESSION['iduser']);
        $return['url'] = $image;
    }
}
$_SESSION['avatar'] = $image;
echo json_encode($return);
开发者ID:sebspas,项目名称:Aurora,代码行数:26,代码来源:changement_avatar.php

示例8: BD

 * Time: 10:47
 */
include_once "first_all.php";
if (isset($_POST) && $_POST != "") {
    $bd = new BD();
    $bd->start_transaction();
    if ($_POST['id'] == 0) {
        $dados['status'] = "Ativo";
        $bd->insert('produtos', $dados);
        $_POST['id'] = $bd->get("insert_id");
    }
    //UPDATE - produtos
    $table = 'produtos';
    $dados = array("nome_produto" => "'" . $_POST['nome_produto'] . "'", "detalhamento" => "'" . $_POST['detalhamento'] . "'", "cod_linha" => $_POST['linha'], "status" => "'" . $_POST['status'] . "'", "url" => "'" . $_POST['url'] . "'", "fios" => $_POST['fios'], "desconto" => "'" . $_POST['desconto'] . "'", "substituido" => $_POST['substituido_por']);
    $where = "codigo={$_POST['id']}";
    $bd->update($table, $dados, $where);
    //DELETE - produto_aplicacao
    $table1 = "produto_aplicacao";
    $where1 = "cod_produto={$_POST['id']}";
    $bd->delete($table1, $where1);
    //INSERT - produto_aplicacao
    foreach (array_keys($_POST) as $k) {
        if (preg_match('/^aplicacao_/', $k)) {
            $dados2 = array("cod_produto" => $_POST['id'], "cod_aplicacao" => $_POST[$k]);
            $bd->insert($table1, $dados2);
        }
    }
    //DELETE - produto_veiculo
    $table2 = "produto_veiculo";
    $str = "";
    foreach (array_keys($_POST) as $k) {
开发者ID:rodrigodeus,项目名称:lockal-1,代码行数:31,代码来源:update_produto.php

示例9: json_encode

<?php

session_start();
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
require_once '../../app/Config.class.php';
require_once '../../app/Bd.class.php';
extract($_GET);
// recupération de l'item
$BD = new BD('item');
$item = $BD->select('idiitem', $iditem);
// ajout de l'item
$BD->setUsedTable('equipement');
$BD->addItem($_SESSION['iduser'], $item->idiitem);
//retrait de l'or
$BD->setUsedTable('user');
$_SESSION['money'] -= $item->prix;
$BD->update('money', $_SESSION['money'], 'iduser', $_SESSION['iduser']);
echo json_encode($_SESSION['money']);
开发者ID:sebspas,项目名称:Aurora,代码行数:19,代码来源:achat-market-item.php

示例10: putOffLine

function putOffLine($iduser)
{
    $BD = new BD('user');
    $BD->update('online', 0, 'iduser', $iduser);
}
开发者ID:sebspas,项目名称:AFK-WEB,代码行数:5,代码来源:logout.php

示例11: header

<?php

if (isset($_SESSION['login'])) {
    header('Location : index.php');
    exit;
}
require_once Config::$path['model'] . 'login.php';
if (isset($_POST['login'])) {
    $BD = new BD('user');
    if ($BD->isInDb("pseudo", $_POST['pseudo']) && (($User = $BD->select("pseudo", $_POST['pseudo'])) && $User->pass == sha1($_POST['password'])) && $User->rang != 0) {
        $BD->update("online", 1, "pseudo", $_POST['pseudo']);
        $iduser = $BD->select("pseudo", $_POST['pseudo']);
        $_SESSION['rang'] = $iduser->rang;
        $_SESSION['iduser'] = $iduser->iduser;
        $_SESSION['avatar'] = $iduser->avatar;
        $_SESSION['pseudo'] = htmlentities($_POST['pseudo']);
        $_SESSION['login'] = 'ok';
        $_SESSION['msg'][0] = 'success';
        $_SESSION['msg'][1] = "Vous êtes connecté !";
        header('Location: index.php');
    } else {
        echo "<div class='error'>Echec de connexion !!! </div>";
    }
}
require_once Config::$path['views'] . 'login.php';
开发者ID:sebspas,项目名称:AFK-WEB,代码行数:25,代码来源:login.php

示例12: BD

<?php

/**
 * Created by PhpStorm.
 * User: rodrigo.martins
 * Date: 22/01/2016
 * Time: 16:57
 */
include_once "first_all.php";
$bd = new BD();
$bd->start_transaction();
$table = "aplicacao";
$dados = array();
$dados['ativo'] = "\"false\"";
$where = "codigo=" . $_GET['codigo'];
$bd->update($table, $dados, $where);
$bd->record_log("log_login", 'delete_aplicacao', $_GET['codigo']);
$bd->commit();
header('Location: ../pages/geral.php');
开发者ID:rodrigodeus,项目名称:lockal-1,代码行数:19,代码来源:delete_aplicacao.php

示例13: BD

<?php 
include 'db.class.php';
$db = new BD();
//echo '<pre>',print_r($_REQUEST, 1),'</pre>';
$res = $db->update("UPDATE whiteliste SET \n\t\t\tcode = :code, \n\t\t\tdescription = :description \n\t\t\tWHERE id = :id", $_POST);
header("Location:gererWhiteliste.php?whitelisteUpdate");
开发者ID:aniss190,项目名称:AlysiaWebAdministration,代码行数:6,代码来源:modifierAddWhiteliste.php

示例14: updateCo

function updateCo($online, $Mail)
{
    $BD = new BD("user");
    $BD->update("online", $online, "mail", $Mail);
}
开发者ID:sebspas,项目名称:Share2Go,代码行数:5,代码来源:logout.php

示例15:

foreach ($donnees as $value) {
    print_r($value);
    echo "</br>";
    echo "{$value->nom}";
    echo "</br>";
}
/* Test Fonction addUser */
$BD->addUser("Jean", "test", 20, "homme", "testpass", 0750, "sebspas@legitan.com");
echo "<h2>Test Fonction addUser </h2></br>";
$donnees = $BD->selectAll();
foreach ($donnees as $value) {
    print_r($value);
    echo "</br>";
}
/* Test update */
$BD->update("nom", "Jeanne", "nom", "Jean");
echo "<h2>Test Fonction UPDATE </h2></br>";
$donnees = $BD->selectAll();
foreach ($donnees as $value) {
    print_r($value);
    echo "</br>";
    echo "{$value->nom}";
    echo "</br>";
}
/* Test delete */
$BD->delete("nom", "Jeanne");
echo "<h2>Test Fonction DELETE </h2></br>";
$donnees = $BD->selectAll();
foreach ($donnees as $value) {
    print_r($value);
    echo "</br>";
开发者ID:sebspas,项目名称:Share2Go,代码行数:31,代码来源:bd_class_test.php


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