views:

30

answers:

3

hi all,

i want to develop search system in my cakephp application, by adding extra functionality in controller, and it works fine.

as you probably guess, after search and viewing record, when i return to index (list) page, i have all results from proper model, and search result is "forgotten".

so i guess that i have to keep my sql query in some sort of php session. can you help me how to manage that.

thank you in advance!

A: 

You basically want to cache the last search results of a session? Could you store the result set in the session variable? One could also think about temporary tables.

sibidiba
A: 

You can use Cache::write, Cache::read and Cache::set (if necessary).

Cache::write() can store any type of object and is ideal for storing results of model finds

bancer
A: 

This is not so much a SQL problem as it is a CakePhp problem. There is a component that handles what you are looking for.

http://bakery.cakephp.org/articles/view/pagination-recall

http://github.com/mcurry/pagination_recall

bucho

related questions