The userLogin and userMail have to be unique otherwise it's possible to have multiple users with the same username which is security whise a bit stupid. I've extended the register function to return an appropriate error message.
mysql_error is deprecated new mysqli_error should be used