Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
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
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:58 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC