Ich brauche einen Tisch in einem assoziativen Array abzufragen Singleton Datenbankverbindung und im immer Fehler mit,Sammeln mysql Abfrage-Ergebnis aus der Tabelle
Notice: Undefined variable: id in C: \ xampp \ htdocs \ SOBCASHIER \ resources \ Vorlagen \ loginmodel.php on line 10
Hinweis: Nicht definierte Variable: Name in C: \ xampp \ htdocs \ SOBCASHIER \ resources \ Templates \ loginmodel.php on line 10
Hinweis: Undefined variable: loc in C : \ xampp \ htdocs \ SOBCASHIER \ Ressourcen \ templates \ loginmodel.php in Zeile 10
Warning: mysqli_stmt :: fetch() erwartet genau 0 Parameter, 3 in C angegeben: \ xampp \ htdocs \ SOBCASHIER \ resources \ templates \ loginmodel.php auf Leitung 10
Hinweis: in C zu bespannen Umwandlungs Array: \ xampp \ htdocs \ SOBCASHIER \ resources \ Templates \ loginmodel.php on line 12 Array
mein db.config.php
define ('HOST','localhost');
define ('USER','garodamas_mon');
define ('PASSWORD','r0d4m45');
define ('DATABASE','garodamas_cashrcv');
class Database{
private $DBH;
private static $singleton;
protected function __construct(){
$this->DBH=new mysqli(HOST,USER,PASSWORD,DATABASE);
}
public static function instance(){
if (!(self::$singleton instanceof self)) {
self::$singleton = new self();
}
return self::$singleton;
}
public static function get(){
return self::instance()->DBH;
}
private function __wake(){}
private function __clone(){}
}
und meine loginmodel.php
<?php
require_once '../db.config.php';
$get=Database::get()->prepare('SELECT user_id, user_name, user_dept FROM mst_user');
$get->execute();
$row = array();
$get->fetch($id, $name, $loc);
while($get->fetch()){
print($row);
}
Ich weiß nicht, wo mein Fehler ist. mst_user hat 3 Spalten. Bitte helfen Sie mir .. danke
SHOW * 'erstellen Problem es wäre SELECT *' – Saty