當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BD類代碼示例

本文整理匯總了PHP中BD的典型用法代碼示例。如果您正苦於以下問題:PHP BD類的具體用法?PHP BD怎麽用?PHP BD使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了BD類的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: insertarComentario

 public function insertarComentario($idpincho, $login, $coment)
 {
     $db = new BD();
     $sentencia = "INSERT INTO comentarios(pincho_idpincho,usuarios_login,fecha,comentario) VALUES('" . $idpincho . "','" . $login . "',NOW(),'" . $coment . "')";
     $res = mysqli_query($db->connection, $sentencia);
     $db->desconectar();
     return $res;
 }
開發者ID:borxa12,項目名稱:G44_ZOTZ,代碼行數:8,代碼來源:Comentarios.php

示例3: insertar

 public function insertar($login, $password, $email, $tipo)
 {
     $db = new BD();
     $sentencia = "INSERT INTO usuarios (login, password, email, tipo) VALUES('" . $login . "','" . $password . "','" . $email . "','" . $tipo . "')";
     $res = mysqli_query($db->connection, $sentencia);
     $db->desconectar();
     return $res;
 }
開發者ID:borxa12,項目名稱:G44_ZOTZ,代碼行數:8,代碼來源:Usuarios.php

示例4: insertar

 public function insertar($login, $foto, $nombre, $reconocimientos)
 {
     $db = new BD();
     $sentencia = "INSERT INTO `juradoprofesional` (`usuarios_login`, `fotojuradoprofesional`, `nombrejuradoprofesional`, `reconocimientos`)\n            VALUES ('" . $login . "', '" . $foto . "', '" . $nombre . "', '" . $reconocimientos . "')";
     $res = mysqli_query($db->connection, $sentencia);
     $db->desconectar();
     return $res;
 }
開發者ID:borxa12,項目名稱:G44_ZOTZ,代碼行數:8,代碼來源:JuradoProfesional.php

示例5: 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

示例6: destroy_session

 public function destroy_session()
 {
     if (session_id() == '' || !isset($_SESSION)) {
         session_start();
     }
     $bd = new BD();
     $bd->record_log("log_login", 'logout');
     session_destroy();
     header('Location:' . $this->session_out);
     exit;
 }
開發者ID:rodrigodeus,項目名稱:lockal-1,代碼行數:11,代碼來源:session.php

示例7: 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

示例8: getFim

 function getFim()
 {
     //Retorna o numero da ultima rodada
     $datafim = 0;
     $db = new BD();
     $sql = sprintf("select\n\t\t\t\t\t   max(addtime(data,hora)) datafim\n\t\t\t\t\t   from\n\t\t\t\t\t   cad_rodada\n\t\t\t\t\t   where \n\t\t\t\t\t   campeonato= %d \n\t\t\t\t\t   and rodada = %d", $this->getCampeonato(), $this->getRodada());
     $db->Query($sql);
     $db->Next();
     $datafim = $db->getValue('datafim');
     $db->Close();
     return $datafim;
 }
開發者ID:alencarmo,項目名稱:OCF,代碼行數:12,代碼來源:class.rodada.php

示例9: 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

示例10: getNbNewMess

function getNbNewMess($iduser)
{
    $nbNewMess = 0;
    $BD = new BD("message");
    $conv = $BD->getConversations($iduser);
    foreach ($conv as $res) {
        $mess = $BD->getMessagesDesc($res->idtrajet);
        //echo $mess->date . " compare to " . $_SESSION['lastco'];
        if ($mess->date > $_SESSION['lastco']) {
            $nbNewMess = $nbNewMess + 1;
        }
    }
    return $nbNewMess;
}
開發者ID:sebspas,項目名稱:Share2Go,代碼行數:14,代碼來源:login.php

示例11: creaFormularioProductos

function creaFormularioProductos()
{
    $productos = BD::obtieneProductos();
    $uri = "http://localhost/tienda/recursos_u5/TiendaOnlineOO/tienda";
    $url = "{$uri}/servicio_sin_wdsl.php";
    $cliente = new SoapClient(null, array('location' => $url, 'uri' => $uri, 'trace' => true));
    foreach ($productos as $p) {
        echo "<p><form id='" . $p->getcodigo() . "' action='productos.php' method='post'>";
        // Metemos ocultos los datos de los productos
        echo "<input type='hidden' name='cod' value='" . $p->getcodigo() . "'/>";
        echo "<input type='submit' name='enviar' value='Añadir'/>";
        echo $p->getnombrecorto() . ": ";
        echo $p->getPVP() . " euros.";
        echo "<input type='submit' name='detalle' value='Mostrar detalle'/>";
        echo "</p>";
        echo "</form>";
        if (isset($_POST['detalle'])) {
            if ($_POST['cod'] == $p->getcodigo()) {
                try {
                    //$unproducto=$cliente->obtieneProducto($p->getcodigo());
                    //echo $unproducto->getPVP();
                    $unprecio = $cliente->obtienePrecioProducto($p->getcodigo());
                    print "<p>Precio :" + $unprecio + "</p>";
                } catch (Exception $e) {
                    echo "Exception: " . $e->getMessage();
                }
                // echo $p->getPVP();
                echo "<p>" + $p->getcodigo() + "</p>";
                echo "<p>" + $p->getnombre() + "</p>";
                echo "<p>:" + $p->muestra() + "</p>";
            }
        }
    }
}
開發者ID:jjaviergr,項目名稱:tienda_soap_ejemplo_basico,代碼行數:34,代碼來源:productos.php

示例12: persist

 public function persist()
 {
     $bd = BD::getConexion();
     $sql = "UPDATE login set estado = 1 WHERE id = :id";
     $stmt = $bd->prepare($sql);
     $stmt->execute([":id" => $this->id]);
 }
開發者ID:jortiz-el,項目名稱:PhP,代碼行數:7,代碼來源:Usuario.php

示例13: persist

 public function persist()
 {
     $conexion = BD::getConexion();
     $update = "Update usuario SET id_liga = :id_liga where id_user = :id_user";
     $query = $conexion->prepare($update);
     $query->execute(array(":id_liga" => $this->id_liga, ":id_user" => $this->id_user));
 }
開發者ID:villapilla,項目名稱:PHP,代碼行數:7,代碼來源:Usuario.php

示例14: getInstance

 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new BD();
     }
     return self::$instance;
 }
開發者ID:Groger63,項目名稱:something-memorable,代碼行數:7,代碼來源:BD.php

示例15: delete

 function delete()
 {
     $conexion = BD::getConexion();
     $insert = "delete from libro where id_libro = :id_libro";
     $query = $conexion->prepare($insert);
     $query->execute([":id_libro" => $this->getId_libro()]);
 }
開發者ID:villapilla,項目名稱:PHP,代碼行數:7,代碼來源:Libro.php


注:本文中的BD類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。