i’m still a beginner, and guess it’s a simple CakePHP question…
all i want is to echo retrieved data from database (one row is selected).
i have next code:
$cover_page = $this->Publication->find('list', array('conditions' => array('Publication.id' => $id)));
now, how can i echo field title from selected database row?
tnx in adv!!!
From the cookbook:
find('list', $params) returns an indexed array, useful for any use where you would want a list such as for populating input select boxes.It will give a result as below
)
Since in your code you’ve specified the
idto make the result only one record,you may not really need to use it, though you can access the title with
$cover_page[$id]if you’ve set the right displayfield.A normal way to do your work would beor
Both of them can get the title by