You shouldn't use back ticks, and instead of LIMIT in the query you should use $db->sql_query_limit. phpBB supports more as just mysql.