<?php
$localhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$dbname = 'Base';
if(!mysql_connect($localhost,$dbuser,$dbpass)){
echo 'Ошибка соединения';
}
if(!mysql_select_db($dbname)){
echo 'Не найду БД';
}
//Обработчик
if(isset($_POST['submit'])){
$text = mysql_real_escape_string($_POST['text']);
if(!empty($text)){
mysql_query("INSERT INTO table SET
text = '".$text."'
);
}
}
echo '<form method="POST">
<input type="text" name="text"><br />
<input type="submit" name="submit" value="Добавить">
</form>';
$result = mysql_query("SELECT * FROM table");
while($res = mysql_fetch_assoc($result)){
echo $res['text'].'<br />';
}