fix: update vales with quotes

This commit is contained in:
Johannes Kantz 2023-01-12 15:09:08 +01:00
parent fe5efbe8f1
commit 5fea5ad15f

View File

@ -71,7 +71,7 @@ class BancaDati {
public function update(string $table, string $id, array $values){ public function update(string $table, string $id, array $values){
$value = ""; $value = "";
foreach ($values as $col => $v){ foreach ($values as $col => $v){
$value .= $col . "=" . $v . ","; $value .= $col . "=" . "'" . $v . "'" . ",";
} }
$value = trim($value, ","); $value = trim($value, ",");
@ -80,6 +80,7 @@ class BancaDati {
$sth = $this->pdo->prepare($sql); $sth = $this->pdo->prepare($sql);
$sth->execute(); $sth->execute();
}catch (PDOException $e){ }catch (PDOException $e){
var_dump($e);
die; die;
} }
} }