use `$db->sql_lower_text('username')` https://github.com/phpbb/phpbb/blob/develop/phpBB/phpbb/db/driver/driver.php#L556