Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: reordering a stack with little effort

by jhourcle (Prior)
on Mar 11, 2005 at 02:07 UTC ( #438495=note: print w/replies, xml ) Need Help??

in reply to reordering a stack with little effort

If you're using Oracle, it's fairly easy:

SELECT ROWNUM, question_id, question FROM questions WHERE SHOW_THE_QUESTION = 1 ORDER BY question_num

If you're using some other database, you can just tick off a counter as you pull them out. You then print and/or refer to the questions by those numbers when you're talking to the user taking the survey. If you're adding/removing questions at a whim, they only really have a 'number' in this sense once the survey/quiz/questionaire/whatever is instantiated, and may change for any other instance. (to build on what Zaxo said)

Update: oops...ROWNUM, not ROW_NUM

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://438495]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2022-05-25 04:39 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (84 votes). Check out past polls.