suche nach name, nicht id
This commit is contained in:
parent
137c0f7550
commit
b8f03d4321
@ -18,8 +18,8 @@ class BenutzerController
|
||||
$this->db = new BenutzerModel();
|
||||
}
|
||||
|
||||
public function getBenutzer($id) {
|
||||
$result = $this->db->selectBenutzer($id);
|
||||
public function getBenutzer($name) {
|
||||
$result = $this->db->selectBenutzer($name);
|
||||
if ($id !== false) {
|
||||
if ($result)
|
||||
$result = $result[0];
|
||||
|
@ -9,13 +9,13 @@ use ppb\Library\Msg;
|
||||
|
||||
class BenutzerModel extends Database
|
||||
{
|
||||
public function selectBenutzer($id)
|
||||
public function selectBenutzer($name)
|
||||
{
|
||||
$pdo = $this->linkDB();
|
||||
|
||||
$params = array();
|
||||
$sql = "SELECT * FROM Benutzerkonto WHERE id = :id";
|
||||
$params["id"] = $id;
|
||||
$sql = "SELECT * FROM Benutzerkonto WHERE name = ':name'";
|
||||
$params["name"] = $name;
|
||||
|
||||
//Ausführen des SQL befehls
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user