$connection = Bitrix\Main\Application::getConnection();
$sqlHelper = $connection->getSqlHelper();
$sql = "SELECT * FROM b_user WHERE
LOGIN = '".$sqlHelper->forSql($keyw)."'
OR EMAIL = '".$sqlHelper->forSql($keyw)."'
OR NAME = '".$sqlHelper->forSql($keyw)."'
";
$recordset = $connection->query($sql);
if ($record = $recordset->fetch())
{