BenutzerController_ExpandedAndEnhanced #14

Merged
PBS2H22AAL merged 2 commits from getBenutzer into main 2024-01-18 12:07:35 +01:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit b8f03d4321 - Show all commits

View File

@ -18,8 +18,8 @@ class BenutzerController
$this->db = new BenutzerModel(); $this->db = new BenutzerModel();
} }
public function getBenutzer($id) { public function getBenutzer($name) {
$result = $this->db->selectBenutzer($id); $result = $this->db->selectBenutzer($name);
if ($id !== false) { if ($id !== false) {
if ($result) if ($result)
$result = $result[0]; $result = $result[0];

View File

@ -9,13 +9,13 @@ use ppb\Library\Msg;
class BenutzerModel extends Database class BenutzerModel extends Database
{ {
public function selectBenutzer($id) public function selectBenutzer($name)
{ {
$pdo = $this->linkDB(); $pdo = $this->linkDB();
$params = array(); $params = array();
$sql = "SELECT * FROM Benutzerkonto WHERE id = :id"; $sql = "SELECT * FROM Benutzerkonto WHERE name = ':name'";
$params["id"] = $id; $params["name"] = $name;
//Ausführen des SQL befehls //Ausführen des SQL befehls
try { try {