Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    24

    Unanswered: 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

  2. #2
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    Start by reading the php manual, especially the sections on cookies, session-id, and hidden fields.

  3. #3
    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

  4. #4
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •