I want to give validation to prevent duplicate entry in category
table.

Now my model is like that:-

class category extends AppModel
{
 var $name = 'Category';
 var $primaryKey = 'categoryId';
 var $validate = array(
       'categoryName'  => VALID_NOT_EMPTY,
   );
}


the controller for addition function:-

function admin_add()
{
  if (!empty($this->data['Category']))
  {
        if ($this->Category->save($this->data))
          $this->flash('Your note has been added.','../categories/',5);
  }
}

what i have to do? Please help me.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to