$insert_sql = "INSERT INTO main (id, nazv,text, user_id)". "VALUES (9,'{$nazv}','{$text}', '{$_SESSION['id']}')";
"ON DUPLICATE KEY (UPDATE `main` SET `id`=9, `text`='{$text}', `nazv`='{$nazv}', `user_id`='{$_SESSION['id']}');
";
mysql_query($insert_sql);
{echo 'ок';}
}
INSERT INTO main (`id`, `nazv`, `text`, `user_id`)
VALUES (9, '{$nazv}', '{$text}', '{$user_id}')
ON DUPLICATE KEY UPDATE
`text`=VALUES(`text`),
`nazv`=VALUES(`nazv`),
`user_id`=VALUES(`user_id`);