$result = mysql_query("SELECT * FROM tablename WHERE username = '$user'");