![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Hobbyist Programmer
Join Date: Sep 2004
Posts: 207
Rep Power: 5
![]() |
$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 |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|