User already exists error in PHP
<p>I'm new in PHP and working with PDO and MySQL. I am going to filter user input data using this code:</p>

<pre><code>if(!filter_input(INPUT_POST,'$username')||!filter_input(INPUT_POST,'$password'))
        {
            echo "username or password already exists....";
        }

        else
        {
$sql = "INSERT INTO users (Username,Password) VALUES (:username,:password)";
$q=$dbh-&gt;prepare($sql);
$q-&gt;execute(array(':username'=&gt;$username,':password'=&gt;$password));
$count=$q-&gt;rowCount();
echo "inserted $count rows.\n";
</code></pre>

<p>But it shows an error, which is simply show the message:</p>

<pre><code>username or password already exists
</code></pre>

<p>If the username or password does not exist it show the same message? If <code>filter_input()</code> should not be used here then what can I use instead?</p>
