Welcome Guest, Not a member yet? Register   Sign In
A Rather Challenging Pagination Problem
#11

[eluser]BrianDHall[/eluser]
[quote author="djreed" date="1262313240"]Ah! Shoulda known this. Thank you! However, can I attach two arrays such as a database result to another array in this way? In other words, $result is already an array - $result['id'], $result['businessname'], $result['url'] are all contained within $result. So in this case what happens when:

Code:
$array[]=$result

And how would I access the results?[/quote]

You'll get a multi-dimensional array, so the first element of $array will be $result, which is an array, and the second element of $array will be the second $result, which is an array.

So to access it would be $array[0]['id] and $array[1]['id'] - this can go infinately deep, so in theory you could built something that looks like this: $array[1]['id'][0][2]['go_fish'], I just don't recommend it Smile
#12

[eluser]Fabdrol[/eluser]
Don't think you need a session, you could just use an URL.
Like this: user submits the first results using $_POST, your controller does something to it and then redirect() 's to an method which takes the ZIP code as an param, and the result id, and the page number, for instance.

Think you can work from there, or do you need some code examples?

-- Fabian
#13

[eluser]djreed[/eluser]
No that's perfect. Thanks guys. Appreciate it!

I'm actually thinking of storing the zip code query using Codeigniter's flashdata (http://ellislab.com/codeigniter/user-gui...sions.html).
#14

[eluser]Fabdrol[/eluser]
Don't you think it will be a good thing, in terms of the user experience, that users can access the app directly using the url, like..
http://www.delivery.com/companies/96703/

then users don't need to use your application's interface évery time, they can just browse to the results right away!

cheers!
#15

[eluser]djreed[/eluser]
That makes sense definitely. I'll seriously consider that option if I can figure out how to implement it.




Theme © iAndrew 2016 - Forum software by © MyBB