Solved

codeigniter next row

Posted on 2014-11-16
9
385 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now