fix: polykame SQL chyby a pliveme je zpatky s pridanym dotazem.

This commit is contained in:
severak 2020-06-23 12:36:02 +02:00
parent 093c6127fa
commit 0d4bdf1a19
1 changed files with 11 additions and 3 deletions

View File

@ -226,9 +226,17 @@ class rows
public function execute(query $Q)
{
$this->log[] = $Q;
$stmt = $this->pdo->prepare($Q->sql);
$stmt->execute($Q->params);
try {
$stmt = $this->pdo->prepare($Q->sql);
$stmt->execute($Q->params);
} catch (\PDOException $exception) {
// TODO - toto elegantněji
throw new usageException(
$exception->getMessage() . ' : ' . PHP_EOL .
$Q->interpolate()
);
}
return $stmt;
}