$namesSelect = "SELECT username FROM users";
$names = mysql_query($namesSelect);
$nameCheck = mysql_fetch_array($names)
This selects all names from the users table and sets them to the array $names.
What I need to do is look through this array using javascript, to find if the name that the user has entered matches. I have no idea where to start with this, so any help would be appreciated.