View Single Post
Old May 25th, 2006, 6:08 PM   #1
BlazingWolf
Hobbyist Programmer
 
Join Date: Sep 2004
Posts: 207
Rep Power: 5 BlazingWolf is on a distinguished road
$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
BlazingWolf is offline   Reply With Quote