Hi,
I've had a script running (quite happily) for a few days now and I've finally put it live onto the site for users to register. In many cases it seems to work fine, but in others I'm having some weirdness.
The query has worked flawlessly - the only error that can possibly (I thought) come up is when a user tries to re-register using an already registered email address - the email field is unique, so obviously returns an error when trying to add a duplicate email.
As such, I wrote the query so that if an error (the only error!) occurs, it says "this email address already exists, please contact us if you wish to renew..." and so on.
What's happening instead is that users who DON'T exist are getting this error message. OK, you think, there's another SQL error coming in somewhere, replace your custom error message with
mysql_query($query) or die (mysql_error());
This I duly did. I deliberately entered a duplicate email address - no error.
I deliberately changed one of the fields in the INSERT query to a field that didn't exist - again, no error!
Do you have any idea what might be causing this and how I can fix it please?
[edit] I've just realised how intermittent it is - I spoke to someone who registered and had this problem - they tried again a few minutes later, entering the same details, but this time it worked. I'm going to say "please refresh the page" in the error message (since I've found this works) but it would be good to stop it from happening...
Many thanks!