I'll assume your using MySQL, and if not, you may need to change the commands. Lets say you have Column1 name as "id", Column2 name as "username", and Column3 name as "password".
SELECT FROM tablename WHERE passowrd = '$value'
or
SELECT FROM tablename WHERE username like %jo% ---will give you john joe johnathan, etc
completeing this...
$query = "SELECT * FROM tablename WHERE passowrd = '$value'";
$result = mysql_query($query,$link);
Now you'll need to do a mysql_fetch_array to get the results of of $result.