I wanted to make this two queries into one query. The purpose of the query is to check if the credentials match in either of the table "user_credentials" or "workers". How can I do so?
SELECT user_name FROM user_credentials WHERE user_name = '$user_email' AND password = '$user_password'
SELECT user_name FROM workers WHERE user_name = '$user_email' AND password = '$user_password'
try this
SELECT user_name FROM user_credentials WHERE user_name = '$user_email' AND password = '$user_password'
union
SELECT user_name FROM workers WHERE user_name = '$user_email' AND password = '$user_password'
then check mysqli_num_rows
or mysql_num_rows
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments