I am getting neighbours based on created date, my id field is not sequential so since they are ordered and displayed in order of created date I get the neighbours the same way.
I see the 2 neighbouring results (debug them also) and they are reversed. Next should be Prev and Prev should be Next, at the beginning or end they end at the correct place except for the direction. Here is SQL output: SELECT `Post`.`created`, `Post`.`id`, `Post`.`title` FROM `Posts` AS `Post` WHERE `Post`.`status` = 0 AND `Post`.`private` <= 1 AND `Post`.`created` < '2010-11-29 11:23:05' ORDER BY `Post`.`created` DESC LIMIT 1 SELECT `Post`.`created`, `Post`.`id`, `Post`.`title` FROM `Posts` AS `Post` WHERE `Post`.`status` = 0 AND `Post`.`private` <= 1 AND `Post`.`created` >= '2010-11-29 11:22:20' AND `Post`.`created` != '2010-11-29 11:23:05' ORDER BY `Post`.`created` ASC LIMIT 2 So get Post with date less than '2010-11-29 11:23:05' which is the time of the Post being viewed so get the Post created right before this one so if I click on the newest Post Prev should be empty but its actually showing the next record 2nd oldest in the DB and Next is empty. Anyone seen this before? Is it just because im using time rather than an actual ID? Thanks, Dave Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
