I have a field area_code in mysql table by php form. I need the validation & alert when typing the same area code which is already entered and stored in database.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The best way you do is to define a
UNIQUEconstraint on fieldarea_codeon the table.if the code was executed and successful, the server will generate an error if you try to enter
area_codethat is already present on the table.