在特定列中查找用户名

I am trying to get this PHP working where it returns true or false if the username exists in the username column on the database:

$data = array($_POST["username"]);


$db = new PDO('mysql:host=localhost;dbname=Example;charset=utf8', 'Example', 'Example');

$stmt = $db->prepare("SELECT FROM Members (username) WHERE username=?");
$stmt->execute($data);

 if(mysql_num_rows($stmt)>=1)
   {
    echo"true";
   }
 else
    {
    echo "false";
    }
SELECT FROM

Does not select anything.

You need to specify what you need to select or just * to select all

SELECT `username` FROM 

OR

SELECT * FROM
SELECT * FROM Members WHERE username=?

Try this statement

SELECT * FROM Members WHERE username

or

SELECT username FROM Members WHERE username

You can fetch a boolean result, from the sql query itself, with minor modification.

SELECT
  count(username) > 0 as user_exists
FROM Members
WHERE username=?

In PHP script just read the result that has either a true (1) or false (0) as value.