diff --git a/BancaDati/BancaDati.php b/BancaDati/BancaDati.php index 50ab02b..79de0e0 100644 --- a/BancaDati/BancaDati.php +++ b/BancaDati/BancaDati.php @@ -44,17 +44,19 @@ class BancaDati { $value = ""; $column = ""; foreach ($values as $col => $v){ - $value .= $v . ","; + $value .= "'" . $v . "'" . ","; $column .= $col . ","; } $value = trim($value, ","); $column = trim($column, ","); - $sql = "INSERT INTO $table($column) VALUES ($value);"; + $sql = "INSERT INTO $table ($column) VALUES ($value);"; + var_dump($sql); try { $sth = $this->pdo->prepare($sql); $sth->execute(); }catch (PDOException $e){ + var_dump($e); die; } }