本文整理汇总了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&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: 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;
}
示例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;
}
示例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;
}
示例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']);
}
示例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;
}
示例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);
}
示例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;
}
示例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 ...";
}
}
示例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;
}
示例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>";
}
}
}
}
示例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]);
}
示例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));
}
示例14: getInstance
public static function getInstance()
{
if (is_null(self::$instance)) {
self::$instance = new BD();
}
return self::$instance;
}
示例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()]);
}