本文整理汇总了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&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);
}
示例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']);
}
示例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 ...";
}
}
示例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);
}
示例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 ...";
}
}
示例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);
}
}
示例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);
示例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) {
示例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']);
示例10: putOffLine
function putOffLine($iduser)
{
$BD = new BD('user');
$BD->update('online', 0, 'iduser', $iduser);
}
示例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';
示例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');
示例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");
示例14: updateCo
function updateCo($online, $Mail)
{
$BD = new BD("user");
$BD->update("online", $online, "mail", $Mail);
}
示例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>";