Solved

codeigniter next row

Posted on 2014-11-16
9
420 Views
Last Modified: 2014-11-17
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
0
Comment
Question by:avir
  • 5
  • 4
9 Comments
 
LVL 8

Expert Comment

by:Ahmed Merghani
ID: 40445654
Hi avir,

Can you explain more?
0
 

Author Comment

by:avir
ID: 40445675
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.
0
 
LVL 8

Expert Comment

by:Ahmed Merghani
ID: 40445793
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.
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

Author Comment

by:avir
ID: 40445848
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?
0
 
LVL 8

Expert Comment

by:Ahmed Merghani
ID: 40445925
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
0
 

Author Comment

by:avir
ID: 40446021
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
0
 
LVL 8

Accepted Solution

by:
Ahmed Merghani earned 500 total points
ID: 40446034
Yes that what I mean, if you insure that itemId is serial numbers. Then, "NEXT" will be this itemId + 1.
0
 

Author Closing Comment

by:avir
ID: 40447166
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.
0
 
LVL 8

Expert Comment

by:Ahmed Merghani
ID: 40447218
Ok and your welcome.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question