I'm trying to make a login script using 2 database tables (authors and editors). I'll post an example of them: Table 1: authors
|id|username|password|
| 1| user | xyz |
Table 2: editors
|id|username|password|
| 1| editor | abcd |
I want to make a single login using these 2 tables. I tried to use:
SELECT * FROM authors, editors WHERE username='mysql_real_escape_string($username)' AND password='mysql_real_escape_string($password)'
but it didn't work. Is there another way that should work for me? Thank you.
You shouldn't do it this way, use one table with in it a roleid or something like it. This will eventually break.
If you really want to do it, no matter what, I would suggest doing a select on the author's table first. No result? Query the editors table.
But as I said, don't do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With