Jump to content


Photo

How to change error message


  • Please log in to reply
1 reply to this topic

#1 agallant

agallant
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 10 March 2005 - 09:27 PM

I have a site that people get emailed registration codes to. When they go to the site there is a box that asks for them to enter there code. If they put in a correct code it pulles there record if they put ion no code or mistype there code the get the following error message

You have an error in your SQL syntax near '' at line 1

How do i change the error message? If it could just say some thing like invalid code please use your back button to try agian would be good enoughf.

Thanks,
AG

#2 micah1701

micah1701
  • Members
  • PipPipPip
  • Advanced Member
  • 613 posts
  • LocationEllington, CT USA

Posted 22 April 2005 - 05:16 PM

You have an error in your SQL syntax near '' at line 1

How do i change the error message? If it could just say some thing like invalid code please use your back button to try agian would be good enoughf.

View Post


You need to modify the php script where it queries the database looking to match the dbase with the users submitted code.

find where it says something similar to:
die(mysql_error())

and change "mysql_error()" to whatever error message you want, so it looks like:
die("sorry, invalid entry")

"Confidence in the face of risk."




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users