prepare("SELECT * FROM Photo p INNER JOIN Categorie c ON c.catId = p.catId WHERE p.photoId = ?"); $req->execute(array($id)); $photo = $req->fetch(); $req->closeCursor(); } catch (Exception $e) { $alert = choixAlert("query"); } } elseif ($bdd instanceof Exception) $alert = choixAlert("query");