|
$this Out of Context
Having a wierd problem with a class i'm trying to write
[PHP]
public static function getID($username)
{
$username = $this->db->escape($username);//this line erros
$sql = "SELECT u_id FROM ".$this->settings['users_table']."WHERE "
.$this->settings['username_col']."='".$username."'";
$res = $this->db->query($sql);
$res = $this->db->fetchArray($res);
$id = $res['u_id'];
return $id;
}
[/PHP]
The error message "Using $this when not in object context". Not really sure what I'm doing wrong, and I used the same line in other lines and it does not error.
Thanks
__________________
_______________________________
BlazingWolf
|