How to display the nickname of the sender of the message in the chat?

I have a chat on my site, but messages without the sender’s nickname. Please help.

Here is the chat itself :

<iframe name='chatWindow' id='chatWindow' src ="iframe.php" width="1265" height="400">
</iframe>
<form action="iframe.php" method="post" name="form" target='chatWindow' >
<p>:<input name="message" type="text" size="75" maxleght="255">
<input name="submit" type="submit" value="OK">
</p>
<br>

A is an iframe:

<?php
if (isset($_POST['message']))
{
$message = $_POST ['message'];
}
$db = mysql_connect("sql-4.zerver.ru","bakugan609","s026y8pjtl");
mysql_select_db("bakugan609",$db);
$result = mysql_query("INSERT INTO messages (message) VALUES ('$message')");
$result = mysql_query("SELECT * FROM messages");
while( $row = mysql_fetch_array( $result ) ){
echo "<br>";
echo "{$row['message']}
";
}
?>

Answer 1, authority 100%

You’ll have to save your nickname first. To do this, in the table where the message is boasted, also make a place for the nickname and then write it:

$result = mysql_query("INSERT INTO messages (message,nick) VALUES ('$message','$nick')");
//    
echo "{$row['nick']}: {$row['message']}";