本文整理汇总了PHP中BD类的典型用法代码示例。如果您正苦于以下问题:PHP BD类的具体用法?PHP BD怎么用?PHP BD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BD类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者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
示例16: conn
public function conn()
{
if (is_null(self::$conn)) {
self::$conn = new PDO('mysql:host=' . HOST . ';dbname=' . BD . '', '' . USER . '', '' . PASS . '');
}
return self::$conn;
}
开发者ID:eduardosilvapereira,项目名称:mcja,代码行数:7,代码来源:BD.class.php
示例17: delete
public function delete()
{
$conexion = BD::getConexion();
$query = "DELETE FROM usuario WHERE id_user = :id_user";
$delete = $conexion->prepare($query);
$delete->execute(array(":id_user" => $this->getId()));
}
开发者ID:villapilla,项目名称:PHP,代码行数:7,代码来源:Usuario.php
示例18: delete
public function delete()
{
$bd = BD::getConexion();
$sql = "DELETE FROM producto WHERE nombre = :nombre";
$stmt = $bd->prepare($sql);
$valido = $stmt->execute([":nombre" => $this->nombre]);
return $valido;
}
开发者ID:jortiz-el,项目名称:PhP,代码行数:8,代码来源:Productos.php
示例19: persist
public function persist()
{
$conexion = BD::getConexion();
$query = "INSERT INTO contactos SET nombre=:nombre, apellidos=:apellidos, telefono1=:telefono1,telefono2=:telefono2, direccion=:direccion, user_id_fk=:user_id_fk";
$result = $conexion->prepare($query);
$result->execute(array(":nombre" => $this->getNombre(), ":apellidos" => $this->getApellidos(), ":telefono1" => $this->getTelefono1(), ":telefono2" => $this->getTelefono2(), ":direccion" => $this->getDireccion(), ":user_id_fk" => $this->getUser_id_fk()));
$this->id = $conexion->lastInsertId();
}
开发者ID:jrtgad,项目名称:Proyectos-ivan,代码行数:8,代码来源:Contacto.php
示例20: persist
public function persist()
{
$bd = BD::getConexion();
$sqlInsertUsuario = "insert into usuarios (nomUsuario, clave) values (:nomUsuario, :clave)";
$sthSqlInsertUsuario = $bd->prepare($sqlInsertUsuario);
$result = $sthSqlInsertUsuario->execute([":nomUsuario" => $this->nomUsuario, ":clave" => $this->clave]);
$this->id = (int) $bd->lastInsertId();
}
开发者ID:jrtgad,项目名称:Proyectos-ivan,代码行数:8,代码来源:Auth.php
注:本文中的BD类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论