Solved

codeigniter next row

Posted on 2014-11-16
9
444 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

737 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