M
M
m4rty2018-09-11 16:20:29
1C-Bitrix
m4rty, 2018-09-11 16:20:29

How to check if email is busy?

I'm making a user profile page with a form and would like to check if this e-mail is in the database, so that I can then display an error like "This E-mail is already in use." Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Panteleev, 2018-09-11
@s_panteleev

if(\Bitrix\Main\UserTable::getList(['filter' => ['EMAIL' => $email]])->getSelectedRowsCount() > 0) {
    // E-mail существует
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question