if ($id = intval($_POST['id']))
mysql_connect();
mysql_select_db('gift');
$table = 'table_1';
if($_SERVER['REQUEST_METHOD']== 'POST')
{
$phone = mysql_real_escape_string($POST['phone']);
$skype = mysql_real_escape_string($POST['skype']);
$email = mysql_real_escape_string($POST['email']);
$adress = mysql_real_escape_string($POST['adress']);
$foto = mysql_real_escape_string($POST['foto']);
if ($id = intval($_POST['id']))
{
$query = "UPDATE `table_1` SET `newid`=[value-1],`phone`=[value-2],`skype`=[value-3],`email`=[value-4],`adress`=[value-5],`foto`=[va lue-6],`create_date`=[value-7],`create_time`=[value-8] WHERE 1;
}
else
{
$query = "INSERT INTO `table_1`(`newid`, `phone`, `skype`, `email`, `adress`, `foto` `create_date`, `create_time`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7],[value-8])";
}
mysql_query($query) or triger_error (mysql_error().'in'.$query);
header("Location: http://".$_SERVER['HTTP_HOST'].$SERVER['PHP_SELF']);
exit;
}
У меня сейчас 5 строк в бд , надо сделать 8 ?