Update register.php

Added error management for registration query