My curent code:
$title = $_POST["title"];
$content = $_POST["content"];
$description = $_POST["summary"];
$tags = $_POST["tags"];
$query = $connect->prepare("INSERT INTO tutorials (title, date, content, description, tags) VALUES (:title, :date, :content, :description, :tags)");
$query->bindParam(":title", $title);
$query->bindParam(":date", $date);
$query->bindParam(":content", $content);
$query->bindParam(":description", $description);
$query->bindParam(":tags", $tags);
$result = $query->execute();
if($result)
{ echo "ok"; } else { echo "not ok"; }
The column title has unique feature if this helps; for some reasons I tried everything from official page the script is stopping if there is any error and I don't want that. If the insert was successfully done I get the "ok" message but if there is any error I don't even get the "not ok" message, the script is dying without any error.
EDIT: The error is stored into a log file on my hosting server but I want to not killing the rest of the webpage in browser.