Cakephp MySql Query with WHERE -


i have work function:

public function index()     {         $this->set('tables', $this->table->find('all'));     } 

but how show column owner = logged user?

you want $this->session->read() returns current authenticated user:-

$this->table->find(     'all',     array(         'conditions' => array('table.user_id' => $this->session->read("auth.user.id"))     ) ); 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -