I am trying to do the same type thing with comparing an array. I am using
this for a security set up so a user can not change values of a form so I
get the list of possible keys
 
//list of possible keys
     $keys = $this->User->$model_name->find('list', array('fields' => 'id',
'order' => 'id ASC'));
     debug($keys);
 
Array
(
    [1] => 1
    [2] => 2
    [3] => 3
    [4] => 4
    [5] => 5
    [6] => 6
)


       
    // values submitted by user   
    $submitted =  $this->data[$model_name][$model_name]; 
    debug($this->data[$model_name][$model_name]); 
       
Array
(
    [0] => 3
    [1] => 5
    [2] => 6
    [3] => 1
)

        //how to compare vales against submitted values?
    $results = array_udiff_assoc($keys, array($submitted));
    debug($results);
 
But i need to compare the keys with the submitted data and that where i am
stuck. I need to check that the submitted values have a match with the
possible values in the database.

Can someone point out my error or suggestions?

Thanks,
 
Dave


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to