server validation to check form value with database
I am trying to set up a server validation to check whether a form value matches a value in the database before allowing the form to be submitted. I have done this before using the number validation, however this time I am using mysqli. Everytime I submit the form it fails (even though I am entering a correct value). I have attached the code.