MySQL Forums
Forum List  »  Newbie

Re: Problem with SQL query from two tables
Posted by: Arie Nagel
Date: August 17, 2005 01:44AM

You're not far off. The query would be:

SELECT t2.id, t2.full_member
FROM table1 t1, table2 t2
WHERE t1.login_t = 'login'
AND t1.password_t = 'password'
AND t1.id = t2.id;

This would get you the id and full_member if the password is correct and an empty record if the password is wrong.

Since you don't seem to be familiair with the SELECT statement I would recommend reading the tutorial:

http://dev.mysql.com/doc/mysql/en/tutorial.html

You can use this to begin experimenting with MySQL. Once you're up and running you should read this article on storing passwords using hashes:

http://phpsec.org/articles/2005/password-hashing.html

Options: ReplyQuote


Subject
Written By
Posted
Re: Problem with SQL query from two tables
August 17, 2005 01:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.