PHP PDO. error number '00000' when query is correct

Viewed 45543

I have the code below:

$sql3 = "update news set date='$time' where id='2'";
$sql3 = $connect->exec($sql3);
if(!$sql3)
{
    print_r($connect->errorInfo());
    $error = $connect->errorInfo();
    die ("Error: (".$error[0].':'.$error[1].') '.$error[2]);
}

When I run the script, sometimes I get error number '00000'. I mean it goes intro the IF. and it is all random. output (sometimes):

Array ( [0] => 00000 [1] => [2] => )

What should I do to fix this problem ?
PS: The script executes correctly every time.

7 Answers
Related