I’m building a registration page that uses JQuery’s validator plugin to validate the form. For the username, i used the remote method. So here’s my jquery+html code: fiddle
And here’s Available.php:
<?php
$usr = $_POST['username'];
$link = new PDO('mysql:host=***;dbname=***;charset=UTF-8','***','***');
$usr_check = $link->prepare("SELECT * FROM Conference WHERE Username = :usr");
$usr_check->bindParam(':usr', $usr);
$usr_check->execute();
if($usr_check->rowCount()>0)
echo false;
else
echo true;
?>
So I have a test account in my database with the username: user. When I tried to submit my form with the same username, it didn’t display the error saying “username taken” which means the php isn’t correct. Any ideas where I went wrong? Thanks
Edit: Ran the website with chrome’s inspector open. When the user name is entered it DOES try to get Available.php but it says “500 internal server error”. Here’s what it looks like:

Alright, after chatting with you for a while, here’s what we found:
1- $_POST should be $_GET, since you’re using a remote method from jQuery.validate.
2- Your code was calling bindParam() on $link instead of $usr_check, which is correct in your question.
Another thing, your code also needs to print out strings for true and false. Wrap those in quotes.