First, you never EVER store a password in plaintext. Never.
Store all your passwords in the database as MD5() hashes.
This makes them useless to any hackers.
Gather the username and password from the user through a webform.
Create an MD5 hash from that password, and compare the outcome with the data that you have in the database.