-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sébastien nourry
committed
Dec 7, 2012
1 parent
e2c1129
commit 4770d83
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div id="content"> | ||
<?php | ||
try { | ||
// On se connecte à MySQL | ||
$bdd = new PDO('mysql:host=localhost;dbname=ndi2012', 'root', ''); | ||
} catch (Exception $e) { | ||
// En cas d'erreur, on affiche un message et on arrête tout | ||
die('Erreur : ' . $e->getMessage()); | ||
} | ||
// Si tout va bien, on peut continuer | ||
// On récupère le derbier article de la table news | ||
// On affiche chaque entrée une à une | ||
$reponse = $bdd->query('SELECT * FROM `article`'); | ||
|
||
while ($data = mysql_fetch_assoc($req)) { | ||
if (isset($_GET["ID"])==$bdd[id]) { | ||
echo 'Région: $bdd[region]<br/>Description: $bdd[description]<br/> Thème: $bdd[theme]<br/> '; | ||
} | ||
} | ||
?> | ||
</div> |
Empty file.