本文整理汇总了PHP中BD::select方法的典型用法代码示例。如果您正苦于以下问题:PHP BD::select方法的具体用法?PHP BD::select怎么用?PHP BD::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BD
的用法示例。
在下文中一共展示了BD::select方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkToken
function checkToken($Pseudo, $tokens)
{
$BD = new BD('user');
$user = $BD->select('pseudo', $Pseudo);
if ($tokens == $user->token) {
return true;
} else {
return false;
}
}
示例2: recupEffectueTrajet
function recupEffectueTrajet($idt)
{
$BD = new BD('effectue');
$res1 = $BD->selectMult("idtrajet", $idt);
$BD->setUsedTable('user');
foreach ($res1 as $tuple) {
$donnees[] = $BD->select("iduser", $tuple->iduser);
}
return $donnees;
}
示例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: recupTrajetReserv
function recupTrajetReserv($id)
{
$BD = new BD('effectue');
$res = $BD->selectMult("iduser", $id);
$BD->setUsedTable('trajet');
foreach ($res as $tuple) {
if ($tuple->idtrajet) {
$result[] = $BD->select("idtrajet", $tuple->idtrajet);
}
}
return $result;
}
示例5: recupJeuInscrit
function recupJeuInscrit($iduser)
{
$BD = new BD('joueur');
$listeJoueur = $BD->selectMult('iduser', $iduser);
$listeJeux = array();
$BD->setUsedTable('section');
foreach ($listeJoueur as $joueur) {
if (!empty($joueur)) {
$listeJeux[] = $BD->select('idjeux', $joueur->idjeux);
}
}
return $listeJeux;
}
示例6: 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 ...";
}
}
示例7: elseif
-->
<object type="text/html" data="http://www.youtube.com/embed/d4JnshyKOOQ?border=0&playerapiid=ytplayer&version=3&modestbranding=0&rel=0&showinfo=0&controls=0&iv_load_policy=3&autoplay=0&loop=1">
</object>
<!-- <iframe src="http://www.youtube.com/embed/d4JnshyKOOQ?enablejsapi=1&playerapiid=ytplayer&version=3&modestbranding=1&autoplay=1&loop=1&border=0&showinfo=0&rel=0&controls=0&enablejsapi=1&iv_load_policy=3" ></iframe> -->
<?php
} elseif (!isset($_GET['jeu'])) {
?>
<img src="<?php
echo Config::$path['images'] . 'bg2.jpg';
?>
" alt="default">
<?php
} else {
$jeu = $BD->select('idjeux', $_GET['jeu']);
?>
<img src="<?php
echo $jeu->image;
?>
" alt="default">
<?php
}
?>
<img src="<?php
if (!isset($_GET['jeu'])) {
echo Config::$path['images'] . 'bg2.jpg';
} else {
$jeu = $BD->select('idjeux', $_GET['jeu']);
echo $jeu->image;
示例8: start_page
/**
* Function start_page()
*
* Construit le header en html
* @param string $titre Le nom de la page
*/
function start_page($titre, $nummenu)
{
?>
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Share2go : <?php
echo $titre;
?>
</title>
<link rel="stylesheet" href='/S2go/dev/webroot/css/style.css'/>
<link href="http://51.255.41.18/S2go/dev/webroot/img/favicon.ico" type="image/x-icon" rel="icon"/>
<link href="http://51.255.41.18/S2go/dev/webroot/img/favicon.ico" type="image/x-icon" rel="shortcut icon"/>
</head>
<body>
<div id="main">
<?php
if ($nummenu == 1) {
?>
<div class="menu">
<div class="menu-logo">
<a class="menu-logo-link" href="index.php"></a>
</div>
<div class="js-menu-btn"></div>
<nav class="menu-navigation">
<ul class="navigation-ul">
<li class="menu-list">
<a class="menu-link <?php
if ($titre == "Home") {
echo 'current';
}
?>
" href="index.php">Home</a>
</li>
<li class="menu-list"><a class="menu-link <?php
if ($titre == "Profil") {
echo 'current';
}
?>
" href="profil.php">Profil</a></li>
<li class="menu-list">
<a class="menu-link <?php
if ($titre == "Messagerie") {
echo 'current';
}
?>
" href="messagerie.php">Messages
<!-- <span class="link-notif"><i class="link-notif-i">3</i></span> -->
<?php
if ($_SESSION['lu'] == false && isset($_SESSION['nbnewmess']) && $_SESSION['nbnewmess'] != 0) {
echo "<span class='link-notif'><i class='link-notif-i'>" . $_SESSION['nbnewmess'] . "</i></span>";
}
?>
<!-- Marche pas ! Pour afficher les bonnes notifs -->
</a>
</li>
<li class="menu-list"><a
class="menu-link <?php
if ($titre == "Proposer un trajet" || $titre == "Enregistrer un vehicule") {
echo 'current';
}
?>
" href="proposer.php">Nouveau trajet</a></li>
</ul>
</nav>
<div class="menu-user right">
<?php
$BD = new BD('user');
$user = $BD->select('iduser', $_SESSION['id']);
?>
<span class="user-avatar left"><img src="<?php
echo IMG . '/' . $user->avatar;
?>
" alt="avatar"></span>
<a class="menu-link right logout0" href="../Controller/logout.php">Se déconnecter</a>
<div class="logout1"><a href="../Controller/logout.php"></a></div>
</div>
</div><!-- // menu -->
<?php
}
if ($nummenu == 2) {
?>
<div class="menu">
<div class="menu-logo">
<a class="menu-logo-link" href="index.php"></a>
</div>
<div class="menu-user right">
<a class="btn2 blue2 right" href="./login.php">Se connecter</a>
//.........这里部分代码省略.........
示例9: array
<?php
require_once "../class/BD.class.php";
require_once "../class/Consultas.php";
$respuesta = "";
$parametros = array();
$campos = array();
$estado = "error";
$cont = 0;
try {
$bd = new BD();
$res = $bd->select(Consultas::LIST_USUARIOS, $parametros);
if ($bd->myException->getEstado() == 0) {
while ($rs = $res->fetch()) {
$cont++;
$estado = "ok";
$campos[] = array("nro" => $cont, "id_persona" => $rs["id_persona"], "nombre" => $rs["pers_nombrecompleto"], "email" => $rs["pers_email"], "telefono" => $rs["pers_telefono"], "celular" => $rs["pers_celular"], "rut" => $rs["pers_rut"], "usuario" => $rs["usua_nombre_usuario"]);
}
}
} catch (Exception $e) {
$estado = "error";
$mensaje = $e->getMessage();
}
$bd = NULL;
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// Fecha en el pasado
header("Content-type: application/json");
$campos = json_encode($campos);
echo $campos;
示例10: 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']);
示例11: 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 du vaisseau
$BD = new BD('spaceship');
$spaceship = $BD->select('idspaceship', $idship);
// ajout du vaisseau
$BD->setUsedTable('vaisseau');
$BD->addVaisseau($spaceship->nom, $spaceship->desc, $spaceship->pv, $spaceship->attaque, $spaceship->defense, $spaceship->xp, $spaceship->nextlevel, $spaceship->type, $spaceship->image, $_SESSION['iduser']);
//retrait de l'or
$BD->setUsedTable('user');
$_SESSION['money'] -= $spaceship->prix;
$BD->update('money', $_SESSION['money'], 'iduser', $_SESSION['iduser']);
// vaisseau définit comme vaisseau courant
$BD->setUsedTable('vaisseau');
$idvaisseau = $BD->select('iduser', $_SESSION['iduser']);
$BD->setUsedTable('user');
$BD->update('idvaisseau', $idvaisseau->idvaisseau, 'iduser', $_SESSION['iduser']);
echo json_encode($_SESSION['money']);
示例12: BD
<?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);
$levelUp = false;
// on donne l'or recue en récompense
$BD = new BD('user');
$user = $BD->select('iduser', $_SESSION['iduser']);
$BD->update('points', $user->points + $points, 'iduser', $_SESSION['iduser']);
//on définit le vaisseau utilisé comme vaisseau courant
$BD->update('idvaisseau', $idvaisseau, 'iduser', $_SESSION['iduser']);
$_SESSION['money'] += $money;
$BD->update('money', $_SESSION['money'], 'iduser', $_SESSION['iduser']);
// on ajoute la mission à la liste des missions effectuées
$BD->setUsedTable('effectue');
// on test si la mission n'a pas déja été effectuée ?
$nbFois = $BD->count2('iduser', $_SESSION['iduser'], 'idmission', $idmission);
if ($nbFois == 0) {
$BD->addEffectue($_SESSION['iduser'], $idmission);
}
// on met à jour l'xp du vaisseau
$BD->setUsedTable('vaisseau');
$vaisseau = $BD->select('idvaisseau', $idvaisseau);
$BD->update('xp', $vaisseau->xp + $xp, 'idvaisseau', $idvaisseau);
$vaisseau = $BD->select('idvaisseau', $idvaisseau);
// on verifie si le vaisseau à level up, si oui on augment ses stats de +5 atk, +2def, +20pv
$newXp = $vaisseau->xp - $vaisseau->nextlevel;
示例13: recupUser
function recupUser($iduser)
{
$BD = new BD('user');
$res = $BD->select("iduser", $iduser);
return $res;
}
示例14: BD
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
</head>
<body>
<?php
require_once "../../Core/utils.php";
echo "<h1>Test Class bd </h1></br>";
echo "<h2>Test Constructeur </h2></br>";
$BD = new BD("user");
echo "Objet crée sur la table : " . $BD->getUsedTable();
/* Test Fonction Select */
echo "<h2>Test Fonction Select </h2></br>";
$donnes = $BD->select("iduser", 1);
print_r($donnes);
echo "</br>";
/* Test Fonction Select */
echo "<h2>Test Fonction SelectAll </h2></br>";
$donnees = $BD->selectAll();
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) {
示例15: 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');
$BD = new BD('equipement');
$listeEquipement = $BD->selectMult('iduser', $_SESSION['iduser']);
$BD->setUsedTable('item');
$listeMyNom = array();
foreach ($listeEquipement as $equipement) {
if ($equipement) {
$Item = $BD->select('idiitem', $equipement->iditem);
$listeMyNom[] = $Item->nom;
}
}
echo json_encode($listeMyNom);