I have the following code
class Auth {
function getMemberByUsername($username) {
$db_handle = new DBController();
$query = "Select * from members where member_name = ?";
$result = $db_handle->runQuery($query, 's', array($username));
return $result;
}
}
In the index I call $user = $auth->getMemberByUsername($username);
and I can use the variable user normally. In the same class I also have the following fuction:
function getMemberNivel($level) {
$db_handle = new DBController();
$query = "Select * from members where nivel = ?";
$result = $db_handle->runQuery($query, 'i', array($level));
return $result;
}
and I call it as follows:
$phase = $auth->getMemberNivel($level);