![]() |
| |||
| Hi This is my query: SELECT IF(ul.email='gggg@ggg.com',1,0) as email, IF(ud.user_mobile_number=1234567890,1,0) as cellphone, IF(ul.loginname='sdsd',1,0) as loginname FROM user_dossier_tbl as ud, user_login_tbl as ul WHERE ( ul.email='gggg@ggg.com' OR user_mobile_number=1234567890 OR ul.loginname='sdsd' ) AND ud.user_id = ul.user_id if there is no user in database with the same email or login name or mobile number it should return: email | cellphone | loginname 0 | 0 | 0 But it's returning: email | cellphone | loginname NULL | NULL | NULL On the other hand if one of the columns have the same value (let's say there is an email gggg@ggg.com in the database) the query returns: email | cellphone | loginname 1 | 0 | 0 Why ? -- Ralph |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |