date('Y-m-d H:i:s'); $result = pg_query_params($db, "SELECT COUNT(*) From Trajet WHERE mailproposition = $1 AND $2 BETWEEN datedepart AND datearrivee;", array($mail, $dateDepart)); $row = pg_fetch_array($result); return $row[0] == 0 && $valide; } //Vérifier que l'utilisateur est bien associé à cette voiture function checkVoiture($db, $mail, $matricule){ $result = pg_query_params($db, "SELECT matricule From Voiture WHERE mail = $1 AND matricule = $2;", array($mail, $matricule)); $row = pg_fetch_array($result); return !strcmp($matricule, $row[0]); }