Преглед изворни кода

catch a stmt->execute sql error, found by the statement failing from duplicate md5 hash

Jad Meouchy пре 9 година
родитељ
комит
e6c1af4ba7
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      cron/filescanner.php

+ 5 - 1
cron/filescanner.php

@@ -138,7 +138,11 @@ function processFile($full_path, $id_company)
 			':file_hash' => $file_hash
 		);
 		
-		if(!$stmt_file->execute($params))
+		try
+		{
+			$stmt_file->execute($params);
+		}
+		catch(Exception $e)
 		{
 			echo "PDO::errorInfo():" . PHP_EOL;
 			print_r($dbh->errorInfo());