iframe:

<?php session_start(); if (isset($_POST['message'])) { $message = $_POST['message']; } $db = mysql_connect("", "", ""); mysql_select_db("bakugan609", $db); if (trim($message) != "") { $time = time(); mysql_query("INSERT INTO messages (message,username,time) VALUES ('$message','{$_SESSION['username']}','$time')"); } $result = mysql_query("SELECT * FROM messages"); while ($row = mysql_fetch_array($result)) { echo "<br>"; echo date('H:i ',$row['time']).$row['username']; echo "&nbsp;: {$row['message']}"; } ?> 

Closed due to the fact that the question is not clear to the participants by default locale , aleksandr barakin , 0xdb , vmchar , Sergey Nudnov May 19 at 12:51 am .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    Normally ask a question, at least what kind of chat, what is written and what is the actual problem, write "how to activate time in the chat?" about the same as writing a computer does not work for me ... - Zowie
  • ok - k0mar
  • one
    @Prikol Edit the original question instead of adding a comment with the code. - Nicolas Chabanovsky

1 answer 1

Fix it

 echo "&nbsp;: {$row['message']}"; 

on

 echo "&nbsp;:".$row['message']; 
  • one
    and the difference between echo "& nbsp ;: {$ row ['message']}"; and echo "& nbsp;:". $ row ['message'] ;? <br> Especially why is this stupid & nbsp especially intrestno? <br> But even more interestingly - why use double quotes if you end up using string quotes with variables? O_o - Zowie