Does Zend Framework provide an elegant way to check if the username already exist in the database?
Or is my only option to code a validator using a combination of php if/else and mysql select statements?
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.
You can add a validator which will check in database if username already exist, if so it will notice the user. I am assuming you are using Zend_Form and Zend_Db_Table with at least one default db table database.
For example:
You will pass 2 parameters to validator, first is table name and second is the column you want to check.
That’s it!