Welcome Guest, Not a member yet? Register   Sign In
Paging records of Array
#1

[eluser]npCoda[/eluser]
Senario
I have fetch hundreds of records from XML to an array variable. When the array is echoed it's out put is :

Quote:array(1) {
["photo"]=>
array(2) {
["@attributes"]=>
array(3) {
["baseURL"]=>
string(36) "http://www.myurl.com/photos/event_name11"
["thumbDir"]=>
string(5) "thumb"
["largeDir"]=>
string(6) "images"
}
["pr"]=>
array(228) {
[0]=>
array(1) {
["@attributes"]=>
array(5) {
["w"]=>
string(3) "650"
["h"]=>
string(3) "433"
["p"]=>
string(10) "194393.JPG"
["n"]=>
string(6) "194393"
["d"]=>
string(0) ""
}
}
[1]=>
array(1) {
["@attributes"]=>
array(5) {
["w"]=>
string(3) "650"
["h"]=>
string(3) "433"
["p"]=>
string(10) "194394.JPG"
["n"]=>
string(6) "194394"
["d"]=>
string(0) ""
}
}

Desire result

I want to display total 15 record in a single page, 5 in each row. Images name and dimension are within
Quote:[“pr”]=>
array(228) {

I have tried using other PHP hard code but couldnot get desire result. It show all the record in single page.

How can I use pagination in CI?


Thank you for support in advance.
#2

[eluser]InsiteFX[/eluser]
Search the forums this question has already been asked!
#3

[eluser]aquary[/eluser]
Cannot clearly understand the question , please enlighten me again.

Quick question for you to check your logic, you want to show 15 records, then whay you have to pulll all of them at the same time? Why don't just select only the needed records?

After that please go read the userguide again. I think you haven't read it throughly yet.
#4

[eluser]CroNiX[/eluser]
@aquary, I think it was pretty clear. His data source is an XML file that has hundreds of entries, but he only wants to display 5 at a time in some sort of pagination type system. So, you can't "just select only the needed records".




Theme © iAndrew 2016 - Forum software by © MyBB