I am doing 2 things to an array:
combine 2 single arrays into one array matching up the keys....works perfect
then sort the combined array based on the percent
$combined = Set::sort($combined, '{n}.percent', 'DESC');
then extracting id in the sorted order from the combined array before
sending to paginate:
$newPosts = Set::extract($combined, '{n}.id'));
which returns the ID of the Post orderd from highest to lowest percentage
match
when i set $newPosts to paginate it automaticaly puts the $newPosts back
into the original order before i ordered them....ordering them by ID DES
which then i look at my posts page after the search and
1st post has percentage match of 57%,
2nd = 33%,
3rd = 87%
when i set the array to be 87%, 57%, 33%
How can paginate not re-order the array? Percent is not a field so order by
does nothing because there is not percent field, percent is created whena
user does a search and results basedon what was found
SQL Error: 1054: Unknown column 'percent' in 'order clause'
Is there someway to stop paginate from automaticaly re-ordering my already
custom ordered array?
Dave
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---