Check record exists db - error show

后端 未结 3 1730
[愿得一人]
[愿得一人] 2021-01-27 07:04

How do I check if username or email exists and then put a error message in my error array. Right now i have:

$sql = \"SELECT username, email FROM users WHERE use         


        
3条回答
  •  梦毁少年i
    2021-01-27 07:17

    You can fetch one row and see if you got same email that you search or same username or both. You can do LIMIT 0,1 if you can stop after finding first row matching either this or that.

提交回复
热议问题