Hey NogDog: Thanks for your reply. Are you sure that's the way to go? Let me explain again to make sure we're on the same page.
A user fills out the Registration form and submits it with the various entries, two of which are a username and an email address. I then move to add their entered info to a members table, where two of the fields of that table are Unique, meaning that MySQL will throw a 23000 exception error is the username or email address is already in the members table.
When it throws this 23000 exception error, it will tell me whether it was the username key or the email key. Now this is where I get lost. The 23000 error shows me what threw it, the username or email keys, and you're telling me that using preg_match is how to solve my issue?
The error itself tells me whether it was the username or email address trying to be duplicated. So I don't understand what preg_match is going to tell me that the error failed to.
If you view the thrown error in one of my above posts, you'll see that it knows which field (email in this case) the error was thrown on. The exception handling has already rooted out that problem for me. But since there are two Unique keys in the table, I would like to know how to use that error information to determine which message to send back to the user, either on their username entry or their email entry. And I just can't see where preg_match is the way to do this. This really has me confused, NogDog. Please remeber, friend, I'm new to the PHP world. And you may very well be right as rain here. I just can't see the logic. This is where you come in again 🙂