Welcome Guest, Not a member yet? Register   Sign In
ajax pagination with data not from a db
#1

[eluser]bigtimslim[/eluser]
The data that I need to page is gathered from several rss feeds, put into a big array, and sorted. Most of the paging examples that I see use a function that takes a couple parameters and then queries a db for the data for that page. I don't want to re-gather all of the data for each page. Does anyone have advice on how to tackle this?
#2

[eluser]darkhouse[/eluser]
store the data in a session using a database?
#3

[eluser]bigtimslim[/eluser]
[quote author="darkhouse" date="1230354629"]store the data in a session using a database?[/quote]

I've thought about passing the whole array to the session, but is it bad to save that much data without using a db?
#4

[eluser]darkhouse[/eluser]
yeah doesn't CI's default session just store everything serialized in a cookie? That could be a crap-ton of data and I'm pretty sure there's a tight limit on how much data you can store in a cookie. But if you just let sessions use a database, then you don't have to worry about that.
#5

[eluser]bigtimslim[/eluser]
Cool. Thanks darkhouse :-)
#6

[eluser]darkhouse[/eluser]
no worries. good luck.
#7

[eluser]Senthilguru[/eluser]
Hi dude,

U can pass an array data between two php script using forms..

Try these steps...i hope this will help u..

1)serialize the array (u want to transfer) and place it in a hidden field in a form
2)post the form where ever u clicks the pagination link..
3)In destination script unserialize the hidden field... u can get the php array

some time u may need to do stripslashes before unserializing the hidden field..


Have a nice day..

Cheers,
senthilguru.e
cogzideltemplates.com
#8

[eluser]darkhouse[/eluser]
That would be a big silly field. What if he's got like 10 rss feeds with 10 articles each - that's 100 articles to handle. I wouldn't want to pass all of that data each time. I think it makes more sense to read the data once, store it in a session (or database) and then just read in the data you need on each ajax call.




Theme © iAndrew 2016 - Forum software by © MyBB