//constructor
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;
//connect to database
$dbhost = "127.0.0.1";
$dbuser = "***";
$dbpass = "****";
$dbname = "****";
$connect = new PDO("mysql:host=$dbhost;dbname=$dbname", $dbuser, $dbpass , [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
}
public function getsiteinfo($login, $id)
{
$getquery = $connect->prepare("SELECT * FROM `***` WHERE `userid` = :login AND `unid` = :unid");
$getquery->execute(array(":login" => $login, ":unid" => $id));
$info = $getquery->fetch_assoc();
return $info;
}