Well you you would do something like this, I am assuming you will be comparing the username and password for authentication
$db = mysql_connect("dbname", "username", "password");
mysql_select_db("dbname",$db);
$result = mysql_query("SELECT * from user WHERE user = '$user'");
if ($result > 0) {
$row = mysql_fetch_array($result);
if ($row["user"] == "$row["password"]) {
//do something
}
else {
print "sorry username and password didntmatch";
}
}
else {
print "no user by that name";
}