Здравствуйте! Почему-то функция не возвращает массив с данными
class Site
{
public function __construct($login , $id = 0 , $mainname = 0, $charset = 0, $email = 0, $index = 0 )
{
$this->id = $id;
$this->userid = $login;
$this->mainname = $mainname;
$this->charset = $charset;
$this->email = $email;
$this->index = $index;
}
public function getsiteinfo($login, $id)
{
$dbhost = "127.0.0.1";
$dbuser = "****";
$dbpass = "****";
$dbname = "***";
$connect = new mysqli ($dbhost, $dbuser, $dbpass, $dbname);
$getquery = $connect->query("SELECT * FROM **** WHERE userid = '$login' AND unid = '$id'");
$info = $getquery->fetch_assoc();
return $info;
}
}
$site = new Site ("admin" ,2);
$site->getsiteinfo ("admin" , 2);
print_r($info);
Ошибка:
Notice: Undefined variable: info in ....