SQL запрос CREATE TABLE `tagbox` ( `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `message` TEXT NOT NULL, INDEX (`ID`), UNIQUE (`ID`) ); PHP - код <? DEFINE("SERVER", "127.0.0.1"); DEFINE("DATABASE", "westland.ath.cx"); DEFINE("USERNAME", "westland.ath.cx"); DEFINE("DBPASSWORD", ""); DEFINE("SHOWTIME", false); // true or false DEFINE("SHOWMESSAGES", "20"); DEFINE("TAGBOXFONTSIZE", "8"); // in pixels DEFINE("TAGBOXWIDTH", "190"); // in pixels DEFINE("TAGBOXHEIGHT", "70"); // in pixels DEFINE("BORDERWIDTH", "1"); // in pixels DEFINE("BORDERCOLOR", "#CCCCCC"); // in HEX DEFINE("BGCOLOR", "#FBFBFB"); // in HEX $db = mysql_connect(SERVER, USERNAME, DBPASSWORD); DEFINE("S", $PHP_SELF); $styleprops = array(TAGBOXFONTSIZE,TAGBOXFONTSIZE,TAGBOXWIDTH,TAGBOXHEIGHT,BORDERWIDTH,BORDERCOLOR,BGCOLOR); function showMessages($m,$s,$style) { $queryGetMessages = "SELECT * FROM tagbox order by ID DESC LIMIT 0, $m"; $resultGetMessages = mysql_db_query(DATABASE, $queryGetMessages); $queryCountMessages = "SELECT * FROM tagbox"; $resultCountMessages = mysql_db_query(DATABASE, $queryCountMessages); $o .=" <form name=\"tagbox\" action=\"$s\" method=\"post\">\n"; $o .=" <input type=\"hidden\" name=\"tagboxa\" value=\"sm\" /> <textarea title=\"# of messages: ".mysql_num_rows($resultCountMessages)."\"\n"; $o .=" style=\"WIDTH: $style[2]px;background-color : $style[6];HEIGHT: $style[3];border: $style[4]px solid $style[5];font-size: $style[0]pt;\" name=\"messages\"\n"; $o .=" readonly=\"readonly\">\n"; for($i=0;$row=mysql_fetch_array($resultGetMessages);$i++) { $o .="$row[message]\n"; } $o .=" </textarea><br />\n"; $o .=" <input name=\"newmessage\"\n"; $o .=" style=\"WIDTH: $style[2]px;background-color : $style[6];border: $style[4]px solid $style[5];font-size: $style[0]pt;line-height: ".($style[0]+1)."pt;\" />\n"; $o .=" </form>\n"; $o .=" <script language=\"JavaScript\" type=\"text/javascript\">\n"; $o .=" document.tagbox.newmessage.focus()\n"; $o .=" </script>\n"; return $o; } function sendMessage($m,$SERVER_NAME,$REQUEST_URI) { if (!$m) { return false; } if (SHOWTIME) { $m = date ("G:i").">$m"; } else { $m = ">$m"; } $m = htmlspecialchars($m); $querySendMessage = "INSERT INTO `tagbox` (`ID`, `message`) VALUES ('', '$m')"; $resultSendMessage = mysql_db_query(DATABASE, $querySendMessage); if (!$resultSendMessage) { return false; } else { header("Location: http://".$SERVER_NAME.$REQUEST_URI); } } switch ($tagboxa) { case "sm": print sendMessage($newmessage,$SERVER_NAME,$REQUEST_URI); break; } mysql_close($db); ?> <html> <head> <title> Tagbox </title> </head> <body> <?print showMessages(SHOWMESSAGES,S,$styleprops);?> </body> </html> Все. Дальше надо данное тебе мной совершенствовать. Работа проста. Пользователь добавляет запись в базу и они выводятся определенным образом.