2
I have an environment where there are two forms of login and tables "Users" and "Establishments", these tables are very similar and I need to return this query based on the email typed in the login form.
I am trying to return by selecting directly in both tables, but it is not correct. ex:
SELECT * FROM {$tabelas->estabelecimentos} as estabelecimento, {$tabelas->usuarios} as usuario WHERE estabelecimento.email = %s OR usuario.email = %s LIMIT 1
But what I need is this: "Select from the establishments table where email = email OR if there is no select from the users table where email = email"