Exemplo n.º 1
0
 public function login($username, $password)
 {
     $db = Database::getInstance();
     $strSQL = "SELECT *           " . "FROM t_USER        " . "WHERE MAIL     = ? " . "  AND PASSWORD = ? ";
     if ($result = $db->queryLaunch($strSQL, array($username, $password))->fetch()) {
         echo 'yes';
     } else {
         echo 'unable to loggin';
     }
 }
Exemplo n.º 2
0
<?php

require_once __DIR__ . '/vendor/autoload.php';
use AppDatabase\Database;
use appClass\User;
$db = Database::getInstance();
echo $db;
echo '<br>';
if ($result = $db->queryLaunch("select count(*) as nb from t_USER")->fetch()) {
    echo $result->nb;
}
echo '<br>';
echo '<br>';
echo '<br>';
$myUser = new User();
$myUser->login("test", "test");
// Contrôleur frontal : instancie un routeur pour traiter la requête entrante
$routeur = new Routeur();
$routeur->routerRequete();