- 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%");
inkanus-gray 03.12.2014 21:06 # +1
bormand 03.12.2014 21:24 # +2
inkanus-gray 03.12.2014 21:25 # +1
bormand 03.12.2014 21:40 # 0
Анонимус 03.12.2014 23:55 # 0
Анонимус 03.12.2014 23:42 # 0
А, я понял: автор этих строк другого вида джойна и не знает. Джойны, как я уже тут говорил, бывают двух видов: правый и левый.
bormand 04.12.2014 07:33 # 0
Да транзакций поди нету, вот и валяются ошмётки...
Анонимус 04.12.2014 17:31 # 0
cyperh 04.12.2014 19:53 # +1
bormand 04.12.2014 20:22 # 0
volhv 04.12.2014 17:25 # 0
Анонимус 04.12.2014 17:30 # +1
guest 03.02.2015 01:09 # 0
guest 03.02.2015 00:43 # 0
Lure Of Chaos 04.12.2014 11:50 # 0