Jump to content

php mysql regex


andyd34

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.