Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try
- {
- // On se connecte à MySQL
- $bdd = new PDO('mysql:host=localhost;dbname=test', 'your_password', '');
- }
- 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 tout le contenu de la table jeux_video
- $reponse = $bdd->query('SELECT * FROM articles');
- // On affiche chaque entrée une à une
- while ($articles = $reponse->fetch())
- {
- ?>
- <p>
- <?php echo $articles['Nom']; ?><br>
- Posteur du sujet : <?php echo $articles['posteur']; ?><br>
- Promo de : <?php echo $articles['promo']; ?> <br>
- Date de la création : <?php echo $articles['date']; ?> <br>
- Heure de la création : <?php echo $articles['heure']; ?>
- </p>
- <?php
- $req = $bdd->prepare('SELECT * FROM dedicace ORDER BY id DESC LIMIT 10');
- $req->execute();
- ?>
- <marquee>
- <?php
- while($dedi = $req->fetch()) {
- ?>
- <b>Par</b> <u><?php echo$dedi['posteur']; ?></u> <b>le</b> <u><?php echo$dedi['date']; ?></u> <b>à</b> <u><?php echo$dedi['heure']; ?></u> <b>==></b> <?php echo$dedi['dedicace']; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement