andyd34 Posted August 23, 2009 Share Posted August 23, 2009 I am constantly getting the following error Fatal error: Call to a member function sql_query() on a non-object I am using this function function pcode_search($code) { if(isset($code)) { $sql = "SELECT user_id FROM phpbb_users WHERE user_pcode regexp '^" . $code . "[0-9]+' = 1"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $result_users[] = $row[0]; } $db->sql_freeresult($result); if(isset($result_users)) { return $result_users; } else { return false; } } } I just cant get my head round it and could do with a second opinion Thanks Link to comment https://forums.phpfreaks.com/topic/171527-php-mysql-regex/ Share on other sites More sharing options...
Bricktop Posted August 23, 2009 Share Posted August 23, 2009 Hi andyd34, Have you defined $db somewhere, either as a global variable or similar? Link to comment https://forums.phpfreaks.com/topic/171527-php-mysql-regex/#findComment-904533 Share on other sites More sharing options...
andyd34 Posted August 23, 2009 Author Share Posted August 23, 2009 Thanks for that, it helped more than you would know. I have added my own functions page to phpbb and am having trouble getting my head around there coding Link to comment https://forums.phpfreaks.com/topic/171527-php-mysql-regex/#findComment-904540 Share on other sites More sharing options...
andyd34 Posted August 23, 2009 Author Share Posted August 23, 2009 http://www.phpfreaks.com/forums/index.php/topic,118755.0.html Link to comment https://forums.phpfreaks.com/topic/171527-php-mysql-regex/#findComment-904541 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.