Hello. In general, there is nothing complicated. We check what has come, soap or phone and accordingly we are trying to deliver an email or phone from the database, to check for the existence of a password.

But I do not want to write govnokod)). How best to organize data verification and query from the database? I would be grateful for advice and assistance.

    1 answer 1

    Search in DB by two fields through OR

    • It may be worthwhile to determine what has come, an int or a regular at least @ look in the string, and after that form a condition where to look? - drop_off pm
    • @drop_off, I personally don’t really see the point in regulars. The fields you, in theory, must be unique, the query is not complicated. Another thing, if you check for validity, but that's another story. - Deonis
    • Well, no problem, you can only check the phone is not int and it seems to me too much. There can be only one match. - binliz
    • And he did. Just thought maybe what the nuances are ... Thank you! - drop_off