Geoff Berrow wrote:
I noticed that Message-ID:
<1e**************************@posting.google.com > from Jaunty Edward
contained the following:
I wanted to know is it posible to have one log in window and then
varify the username password from 2 different table in same DB.
that means I have one log in form and then I take info from 2
different tables to varify if the user-pass combination in any of the
table maches to the input values.
My bosss wants me to make soemthign like this, as far as I know its
not posible in PHP but still comfirming
Don't see why it's not possible. I'm not sure /why/ you'd want to do it
that way but there is no problem running multiple queries
table1
id
username
table2
id
password
select a.username,b.password from table1 a, table2 b
where a.id = b.id and
a.username = '$username' and
b.password = password('$password');
If the record set is empty, there is no match and you should re-direct to the
login page.
or even a single query using a simple join. If your boss is thinking about
security, well, anyone that gets access to db would eventually figure out the
entity relationships and still get what they want.
For passwords in MySQL, you can PASSWORD() to encode them. This is a one-way
encryption. In other words you would verify that the encrypted version of the
password passed in on the form is the same as the stored password in the
database and there are no tools/methods to unscramble the password to find out
what the real password is.
--
Michael Austin.
Consultant - Available.
Donations welcomed.
Http://www.firstdbasource.com/donations.html
:)