- 1
- 2
- 3
- 4
- 5
// проверяем на дубли
$email_exists = $db->select('SELECT * FROM customers_info AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.email LIKE ?', "%$email%")
|| $db->select('SELECT * FROM customers_info_inpr AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.inpr_email LIKE ?', "%$email%")
|| $db->select('SELECT * FROM customers_info_org AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.org_phone LIKE ?', "%$email%")
|| $db->select('SELECT * FROM customers_info_org AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.contact_phone LIKE ?', "%$email%");