Hy,
I have a users table in mysql with username and alias set to UNIQUE .If i try to insert something that already is there i get the error : #1062 - Duplicate entry 'Ramocea' for key 'alias' which is good.
But i want to show the users messages like this :
Alias already exist in database and Username already exist in the database not that mysql_error .
Is there need for a check to the database and if $mysqi->num_rows > 0 - return false; ? Or is there a method to manipulate what mysql throws as error and replace the messages ?
Thank you very much …
If you want to do everything in one query:
But I would recommend you to check for existing values beforehand: