<form action="libs.php" method="post">
<input name="text1" type="text" value="<?=$row['text1'] ?>"/><br/>
<input name="text2" type="text" value="<?=$row['text2'] ?>"/><br/>
<input name="text3" type="text" value="<?=$row['text3'] ?>"/><br/>
<input name="text4" type="text" value="<?=$row['text4'] ?>"/><br/>
<input name="text5" type="text" value="<?=$row['text5'] ?>"/><br/>
<input name="id" type="hidden" value="<?=$row['id'] ?>"/>
<input name="ok" type="submit"/>
</form>
и в libs.php такой скрипт
mysql_connect();
mysql_select_db('gift');
$table = 'table_1';
if($_SERVER['REQUEST_METHOD']== 'POST')
{
$name = mysql_real_escape_string($POST['name']);
if ($id = intval($_POST['id']))
{
$query = "UPDATE $table SET $name = '$name' WHERE id = '$id'";
}
else
{
$query = "INSERT INTO $table SET name = '$name'";
}
mysql_query($query) or triger_error (mysql_error().'in'.$query);
header("Location: http://".$_SERVER['HTTP_HOST'].$SERVER['PHP_SELF']);
exit;
}
И в бд я создал таблицу из 6 ячеек .
Помогите доработать код !