Link to home
Start Free TrialLog in
Avatar of avir
avir

asked on

codeigniter next row

Hi
I'm trying to initially show the first row result when clicking on a link and then allow the next row to come up by clicking on a "Next" button. I've got the first row result showing, but I can't figure out how to allow the next row to come up on a click.
You can see the page at http://www.imj.org.il/isaiah/verses/
Click on a chapter link and it returns the first results of that chapter.
I would appreciate any assistance.
Thanks,
controller.txt
model.txt
view.txt
Avatar of Ahmed Merghani
Ahmed Merghani
Flag of Sudan image

Hi avir,

Can you explain more?
Avatar of avir
avir

ASKER

Hi Ahmed
I don't know what additional information I could add. What else would you need to know?
 I would like to know how I could make an additional query, after making the initial query which returns the first row, that would return the next row. And so on.
Can you show us the "index" function that list the chapters?
Why links -at chapter 1 for example- goes to the same point? I think you need to add "itemID" to the link which will be used to refer to the NEXT row.
Avatar of avir

ASKER

I'm not sure what you mean by index function. These are the columns in my items db table which is joined to the book of isaiah db table on  verseId:

itemId | image | chapter | verse | title | label | link | dsslink | verseId

and I'm simply returning all the rows that belong to any particular chapter.
Are you suggesting that I increment  itemId inorder to go to the next row?
There is a function that shows all the chapters when we call the link:
http://www.imj.org.il/isaiah/verses/

Open in new window

When you do not specify the called funciton in the url, CodeIgniter default function is "index". That what was I am talking about.
Now the issue is in that page, for example, all "View Chapter" links for chapter 1 has the same link!!
I think the links should be something like this:
http://www.imj.org.il/isaiah/verses/view/?ch=1&itemID=1001

Open in new window

http://www.imj.org.il/isaiah/verses/view/?ch=1&itemID=1002

Open in new window

and so on
Avatar of avir

ASKER

Oh okay, that index function.  Anyways I think I see where you are going with this and it might be a good idea.
I guess I just have to increment the itemId in the query for each "Next".
index.txt
ASKER CERTIFIED SOLUTION
Avatar of Ahmed Merghani
Ahmed Merghani
Flag of Sudan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of avir

ASKER

Thanks for your help, though I'm having some problems implementing this. But now we are rethinking the whole project and I will probably have to change queries so there's no point in dealing with this right now.
Ok and your welcome.