From 5fea5ad15f1f670234ec717e6de7480adab4002c Mon Sep 17 00:00:00 2001 From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com> Date: Thu, 12 Jan 2023 15:09:08 +0100 Subject: [PATCH] fix: update vales with quotes --- BancaDati/BancaDati.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BancaDati/BancaDati.php b/BancaDati/BancaDati.php index 12f9205..dd4823a 100644 --- a/BancaDati/BancaDati.php +++ b/BancaDati/BancaDati.php @@ -71,7 +71,7 @@ class BancaDati { public function update(string $table, string $id, array $values){ $value = ""; foreach ($values as $col => $v){ - $value .= $col . "=" . $v . ","; + $value .= $col . "=" . "'" . $v . "'" . ","; } $value = trim($value, ","); @@ -80,6 +80,7 @@ class BancaDati { $sth = $this->pdo->prepare($sql); $sth->execute(); }catch (PDOException $e){ + var_dump($e); die; } }