add: delete items from list

This commit is contained in:
Johannes Kantz
2023-01-24 09:01:23 +01:00
parent b2ce4f829d
commit c8582c8813
2 changed files with 16 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ class BancaDati {
private $dbName = "BancaDati";
private $linkName = "localhost";
private $user = "root";
private $pw = "root";
private $pw = "";
public $pdo;
public function __construct() {
@@ -55,8 +55,10 @@ class BancaDati {
try {
$sth = $this->pdo->prepare($sql);
$sth->execute();
return $this->pdo->lastInsertId();
}catch (PDOException $e){
die;
return false;
//die;
}
}
@@ -128,7 +130,7 @@ class BancaDati {
}
$sql = "SELECT * FROM " . $table . ((count($where) > 0) ? " WHERE ".$whereString.$orderString : "") .";";
try {
return $this->pdo->query($sql)->fetchAll();
return $this->pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);
}catch (PDOException $e){
die;
}