Solved

codeigniter next row

Posted on 2014-11-16
9
460 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article discusses four methods for overlaying images in a container on a web page
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn how to dynamically set the form action using jQuery.

691 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