News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

The Bakery:
Checking for duplicate records (unique record)
January 23, 2007 @ 15:33:00

On The Bakery, there's a new expanded tutorial (from this) that talks about how to check for duplicate records in your CakePHP model.

[Here's how to] validate a form field (such as a user name field), both in add and edit form and make sure that the selected user name does not already exist in the database [via a] function repeated only once (in app/app_model.php).

The example model they give defines an isUnique method that essentially runs an automatic check (a count() call) on the table to see if the given information exists. The example Model, View, and Controller are all given.

0 comments voice your opinion now!
unique record cakephp model form information count database unique record cakephp model form information count database


blog comments powered by Disqus

Similar Posts

NetTuts.com: Zend Framework from Scratch - Models and Integrating Doctrine ORM

The Bakery: For Beginners: Famous pitfalls with Cake development

Jim Plush's Blog: Rethinking Zend Models Part 3 - Validation

Job Posting: Doubledot Media Limited Seeks CakePHP Developer (Christchurch, Canterbury, New Zealand)

DotVoid.com: Reordering nested sets using PHP and Javascript


Community Events





Don't see your event here?
Let us know!


interview framework language community podcast bugfix zendserver api deployment release threedevsandamaybe series symfony introduction tips voicesoftheelephpant code conference laravel list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework