1
Coding / Re: Programming Q&A
« on: April 12, 2009, 02:17:52 am »
Assuming that $connector is a PDO object... Try this instead:
Code: [Select]
//Everything is good, update the database
$query = "UPDATE news SET title = ".$newstitle.", post = ".$newspost.", date = ".$date." WHERE id = ".$id." LIMIT 1 ";
$result = $connector->exec($query);
if ($result==1)
{
header("location:index.php");
}
else
{
$error = "Error, could not insert into database!".$result.$id."";
header("location: index.php?action=error&message=".$error."");
}