Thank you guys! I've got working code now, thanks to you. And it looks like this:
<?php
require 'DB/dbinc.php';
$oT = $_POST['starinaslov'];
$nT = $_POST['novinaslov'];
$nTx = $_POST['novitekst'];
try {
// Connect and create the PDO object
$conn = new PDO("mysql:host=$dbhost; dbname=$dbname", $usernm, $dbpass);
$conn->exec("SET CHARACTER SET utf8"); // Sets encoding UTF-8
//Update
$sql = "UPDATE bloging SET title=:ntitle, tekst=:ntext WHERE title=:oldtitle";
$stmt = $conn->prepare($sql);
$stmt->execute(array(
':ntitle' => $nT
, ':ntext' => $nTx
, ':oldtitle' => $oT
));
$conn = null; // Disconnect
}
catch(PDOException $e) {
echo $e->getMessage();
}
?>