Skip to content

Commit

Permalink
creation d'article
Browse files Browse the repository at this point in the history
  • Loading branch information
sébastien nourry committed Dec 7, 2012
1 parent e2c1129 commit 4770d83
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions article.php
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 added article.txt
Empty file.

0 comments on commit 4770d83

Please sign in to comment.