Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. Array
  2. (
  3. [0] => Array
  4. (
  5. [AdoPosition] => Array
  6. (
  7. [name] => Sahbaj
  8. )
  9.  
  10. )
  11.  
  12. [1] => Array
  13. (
  14. [AdoPosition] => Array
  15. (
  16. [name] => test-name
  17. )
  18.  
  19. )
  20.  
  21. )
  22.  
  23. $name = $this->AdoPosition->find('all',
  24. array(
  25. 'fields'=>'AdoPosition.name',
  26. 'group'=>'AdoPosition.name'
  27. ));
  28. pr($name);
  29.  
  30. $name = $this->AdoPosition->find('list', array(
  31. 'fields' => array('AdoPosition.name', 'AdoPosition.name'),
  32. 'group' => array('AdoPosition.name')
  33. ));
  34. $name = implode(',', $name);
  35.  
  36. "Sahbaj,test-name"
  37.  
  38. $data = $this->AdoPosition->query('SELECT GROUP_CONCAT(DISTINCT name) from your_table_name;');
  39.  
  40. $result = implode( ",", Set::classicExtract($name, '{n}.AdoPosition.name'));
  41.  
  42. echo $result; // Sahbaj,test-name
  43.  
  44. $names=Set::extract("/AdoPosition/name",$array);
  45.  
  46. $names = $this->AdoPosition->find('list', array('fields'=>array('name')));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement