Here's what I've got:
class UserDBServices extends QueryServices
{
function authenticate($userName, $userPass) {
$query = ("SELECT user_id, username, password, AccountName, security_level, security_desc, banned
FROM user_login, lu_user_security
WHERE user_login.security_level = lu_user_security.security_id
AND user_login.username = '$userName'
AND user_login.password = '$userPass'");
$dbObj = $this->QueryServices(); //this is the constructor for the base class. it is a database connection
$resObj = $this->dbObj->_allQuery($query);
//create a new User object uponsuccessful login
if(!$this->result[0][0] == null) {
$this->user = new UserBO();
$this->user->setId($this->result[0][0]);
$this->user->setFirstName($this->result[0][3]);
$this->user->setSecLevel($this->result[0][4]);
$this->user->setSecDesc($this->result[0][5]);
$this->userView = serialize($this->user);
$_SESSION['userView'] = $this->userView;
}else{
$_SESSION['loginError'] = 'loginError';
header('location:'.LOGIN_FORM_VIEW);
}
}
}
I'm not sure if can use the 'new' keyword inside the class or not.