suche nach name, nicht id
This commit is contained in:
parent
137c0f7550
commit
b8f03d4321
@ -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];
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user