i think my question was not clear. sorry for confusing you. i dont want to order the fields - its about ordering the records. ===================== table (this is what i have for example) id, name 1, john 2, james 3, anthony 4, ben 5, jonathan =====================
now i want to get the results via findAll() or any other method, to get the results in a number of ways. for example, i may want the output to start from ID 3. since its a findAll(), the record with ID 1 and 2 will added after ID 5. =============== output (starting from ID 2) 3, anthony 4, ben 5, jonathan 1, john 2, james =============== the above example is for only 5 records. but my table has over 200 records. please help me. thanks On Jun 20, 3:28 am, Joel Perras <[EMAIL PROTECTED]> wrote: > A similar question had been posed on the mailing list a week or so > ago: http://tinyurl.com/467kx7 > The short answer is that if you are using MySQL, you can use ORDER BY > FIELD(id, 2,3,4,5,1). > > -Joel. > > On Jun 19, 5:17 pm, Fahad <[EMAIL PROTECTED]> wrote: > > > i wil make it easy by showing an example. > > lets say, i have only 5 records in my database table. and they all > > have an ID field of 1, 2, 3, 4, and 5. > > > i want the findAll() to work in such a way so that i can start the > > number of records at a given ID. > > for example, i want the records returned by findAll to start from 2. > > like this: 2, 3, 4, 5, 1 (1 will be added at the end) > > > when i want to start its ordering from 3, it will be like this: > > 3, 4, 5, 1, 2 (1 and 2 will be added at the end) > > > can anyone help me with it? > > > thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
