Hello,

I've searched this group and all other resources (bakery, manual,
book, API), but I found no useful results ...

I have a table and that table contain some fields (it's only one table
no HABTM here and no two tables relations):

id
.
.
catid
.
.


I just mentioned the important fields ...

and I have a function that takes $catId as parameter

function getLastPost($catId) {
  $this->set('post', $this->Post->findByCatid($catId));
}

this function return an array of results where the table field 'catid'
= $catId (the parameter)

what should i do to return only one result ordered by (table field) id
desc, because I want only the one result with the last id (I want to
use to show the last post from many categories)

I mean something like that:

SELECT * FROM posts WHERE catid = $catId ORDER BY id DESC;

if I stick with this solution (give cake a query) ... cake returned an
array based on 0,1,2,... locations but the API methods (find,
findBy..) returned different array, based on table name instead of
numbers

I want a cakePHP function to do this query and return a will formated
array:


was that clear enough or not :S ??
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to