# |
Oct 22nd 2009, 14:23 |
joeb |
I always used am($this->params['named'], array('limit' => 10, 'page' => 1)) for my controllers. |
# |
Oct 22nd 2009, 14:21 |
cpierce |
limit 20, $currentoffset+20; |
# |
Oct 22nd 2009, 14:21 |
nicoleG |
thanks |
# |
Oct 22nd 2009, 14:21 |
nicoleG |
great |
# |
Oct 22nd 2009, 14:21 |
nicoleG |
mysql 5 |
# |
Oct 22nd 2009, 14:21 |
cpierce |
yeah just send the variable + 30 or whatever as your offset |
# |
Oct 22nd 2009, 14:21 |
nicoleG |
nope, |
# |
Oct 22nd 2009, 14:21 |
nicoleG |
between* |
# |
Oct 22nd 2009, 14:21 |
markstory |
I hope you're not using old mssql, there is no limit/offset. |
# |
Oct 22nd 2009, 14:21 |
nicoleG |
er |
# |
Oct 22nd 2009, 14:21 |
nicoleG |
? |
# |
Oct 22nd 2009, 14:21 |
nicoleG |
then i will just need to create the links to paginate below my data chunks/ |
# |
Oct 22nd 2009, 14:20 |
cpierce |
will do the offset for you |
# |
Oct 22nd 2009, 14:20 |
cpierce |
LIMIT 3, 30 |
# |
Oct 22nd 2009, 14:20 |
nicoleG |
thank you |
# |
Oct 22nd 2009, 14:20 |
nicoleG |
i will look in to it :) |
# |
Oct 22nd 2009, 14:20 |
markstory |
its good stuff. |
# |
Oct 22nd 2009, 14:20 |
nicoleG |
never used OFFSET |
# |
Oct 22nd 2009, 14:20 |
joeb |
nicoleG: LIMIT and OFFSET |
# |
Oct 22nd 2009, 14:20 |
nicoleG |
yes joeb |
# |
Oct 22nd 2009, 14:19 |
nicoleG |
yeah markstory, that makes sense |
# |
Oct 22nd 2009, 14:19 |
joeb |
nicoleG: But, it's coming from ->query() ? |
# |
Oct 22nd 2009, 14:19 |
nicoleG |
basically yes joeb, that's what i have |
# |
Oct 22nd 2009, 14:19 |
markstory |
you are loading 10 million rows into memory and then showing 20. |
# |
Oct 22nd 2009, 14:19 |
joeb |
nicoleG: I thought you meant that you had some big static array that you wanted to essentially paginate through. |
# |
Oct 22nd 2009, 14:19 |
markstory |
nicoleG: just think if you have 10million rows. |
# |
Oct 22nd 2009, 14:19 |
nicoleG |
damn |
# |
Oct 22nd 2009, 14:19 |
markstory |
generating html is free most times incomparison to quering and processing. |
# |
Oct 22nd 2009, 14:19 |
joeb |
nicoleG: Oh, then yeah, array_slice != what you want. |
# |
Oct 22nd 2009, 14:19 |
alan|macbook |
okaaaay... Back on track... |
# |
Oct 22nd 2009, 14:18 |
nicoleG |
but i need to paginate the data still |
# |
Oct 22nd 2009, 14:18 |
joeb |
Oh, yeah. I thought they meant for just some big array, how to get a chunk out. |
# |
Oct 22nd 2009, 14:18 |
nicoleG |
markstory, i have a query that's not using model relationships |
# |
Oct 22nd 2009, 14:18 |
markstory |
pagination is supposed to make the server load lighter. |
# |
Oct 22nd 2009, 14:18 |
joeb |
markstory: ? |
# |
Oct 22nd 2009, 14:18 |
nicoleG |
ok, thanks |
# |
Oct 22nd 2009, 14:18 |
markstory |
but you are kind of missing the train on pagination if you use array slice. |
# |
Oct 22nd 2009, 14:17 |
joeb |
nicoleG: array_slice. |
# |
Oct 22nd 2009, 14:17 |
markstory |
nicoleG: no |
# |
Oct 22nd 2009, 14:17 |
nicoleG |
can i use the paginate method to paginate an array that's not a model? |
# |
Oct 22nd 2009, 14:17 |
ADmad |
yup just the url is surely not enough |