1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<?php
$bdd = new PDO('mysql:host=127.0.0.1;dbname=membres', 'root', '');
$liste2 = 0;
$req = $bdd->prepare('SELECT message as tout2 FROM chat');
$req->execute(); // ici, rien à passer en arguments
$row = $req->fetch(); // on récupère une ligne
$liste2 = $row['tout2'];
?>
<html>
<head>
<title>Test de chat</title>
<meta charset="utf-8">
<meta http-equiv="Refresh" content="40">
</head>
<body>
<br>
<a href="iframe.php">Rafraichir la page !</a>
<?php
$allmsg = $bdd->query('SELECT * FROM tchat ORDER BY id DESC');
while($msg = $allmsg->fetch())
{
?>
<font size="7pt"><center><b><?php echo $msg['pseudo']; ?> :</b> <?php echo $msg['message']; ?><br/></center></font>
<?php
}
?>
</body>
</html> |
Partager