18 lines
436 B
PHP
18 lines
436 B
PHP
<?php
|
|
|
|
require_once("lib/getPDD.php");
|
|
|
|
$bdd = getPDO();
|
|
|
|
if ($bdd instanceof PDO) {
|
|
try {
|
|
$req = $bdd->prepare("SELECT * FROM Utilisateur WHERE nom = ?");
|
|
$req->execute(array($username));
|
|
|
|
if (!$user = $req->fetch())
|
|
$alert = choixAlert("login");
|
|
} catch (Exception $e) {
|
|
$alert = choixAlert("query");
|
|
}
|
|
} elseif ($bdd instanceof Exception)
|
|
$alert = choixAlert("connexion");
|