Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.38 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I take a mysql query and print the results on a cakephp page
  2. $users = $this->User->find('all', array('order'=> array('User.rating' => 'desc'), 'conditions'=>array('User.rating >' => '50')));
  3. $this->set('users', $users);
  4.        
  5. <?php
  6. foreach ($users as $user):
  7.    echo $this->Html->link("View User", array('controller' => 'users', 'action' => 'view', $user['id']));
  8. endforeach;
  9. ?>