Hello! There is a form: https://jsfiddle.net/pkhyLvcc/
Strange, but on the fidle works on Stack'e not. Well, okay, I think it does not bother much.
The task is as follows: check the <input id='email'/> field and <input id='name'/> for this condition
<?php if(mysqli_num_rows(mysqli_query("SELECT `users` WHERE `email` = '$email'"))){ echo "<script type='text/javascript'> fail = 'email is already used'; $('#mailErr').text(fail); </script>"; } ?> By the way, yes, in the SQL query, the reverse apostrophes were removed.