Im trying to see if a username is already taken.
$query = mysql_query("SELECT * FROM members_tbl WHERE username = ' ".$_POST['username']." '");//Edit the query to fit your needs
$result = mysql_num_rows($query);
if($result[0] === ($username)) {
echo "The username you have chosen is available"; //Does not exist!
}else{
echo "The username you have chosen already exists!"; //It is there
}
Whats wrong with my code?