If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > Need a query that will set new limits each time

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-23-10, 12:58
DevilsAdvocate DevilsAdvocate is offline
Registered User
 
Join Date: Apr 2010
Posts: 24
Need a query that will set new limits each time

Couldn't find an SQL forum, so if I'm in the wrong place, my apologies. I need help building a query.

Ok. I have an app that produces a quiz. The Questions are in a db. The first time the query executes, I want to get 1-5. When the user clicks next, I would like the query to change to 6, 10 on the LIMIT. Get me? But without a series of static pages. So in general, when the user clicks next, I want to process the results, set new limit values and redisplay the SAME page with different questions (not quizpg1, quizpg2, etc.)

Am I explaining decently?

Any ideas how I could get this accomplished?
__________________
DevilsAdvocate
------------------------
The elephant in the room
------------------------
Ordo ab chao
Reply With Quote
  #2 (permalink)  
Old 04-23-10, 13:50
kitaman kitaman is offline
Papabi's friend
 
Join Date: Sep 2009
Location: Ontario
Posts: 629
Start by reading the php manual, especially the sections on cookies, session-id, and hidden fields.
Reply With Quote
  #3 (permalink)  
Old 04-23-10, 14:13
DevilsAdvocate DevilsAdvocate is offline
Registered User
 
Join Date: Apr 2010
Posts: 24
Quote:
Originally Posted by kitaman View Post
Start by reading the php manual, especially the sections on cookies, session-id, and hidden fields.
Thanks, I'm aware of those. It was more of an SQL question. I was wondering if SQL had a function or something, or if somebody had encountered a similar situation and found a trick. Appreciate the lead though, maybe Ill refresh and see what they have to offer instead.

I know how to do it with a function and a JS onclick event handler passing through _GET, but wanted to know if mysql or sql itself had any better routes.
__________________
DevilsAdvocate
------------------------
The elephant in the room
------------------------
Ordo ab chao
Reply With Quote
  #4 (permalink)  
Old 04-23-10, 15:47
DevilsAdvocate DevilsAdvocate is offline
Registered User
 
Join Date: Apr 2010
Posts: 24
Think I found an answer good enough to suit me. Thanks
__________________
DevilsAdvocate
------------------------
The elephant in the room
------------------------
Ordo ab chao
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On