如果值在mysql中,则返回true

I am writing a program that should connect to a php file on my website. In the C# they enter a value (password). The password would then be sent to the webpage (example.com/example.php?param=<password>)

I know how to make the program send the password but I don't know how to compare the value entered to a value in a table of my mysql database. If the value is in the database I want it to return true.

sql

    SELECT `password`
    FROM `tableName`
    WHERE `password` = :password

:password should be the value you are checking for in the database

select 1 from your_table where password = 'thepass'
$result = mysql_query("SELECT * FROM table1 where password = '$password'", $link);
$num_rows = mysql_num_rows($result);
if($num_rows >0)
   return true;
return false;