slowpoke115 wrote:
> I want the quiz writer to be
> able to input how many questions are asked, I'm having
trouble outputting the
> number of questions specified if that makes any sense.
So in my maker page I've
> got the user specifying the number of questions = 4 and
then on the actual quiz
> I want to output the 4 questions specified.
I presume that you want the questions to be selected at
random, so this
is the SQL query you need:
SELECT * FROM questions
ORDER BY RAND() LIMIT 4
Since the number of questions will be variable, you need to
create a
runtime variable, so you enter this in the Advanced Recordset
dialog box:
SELECT * FROM questions
ORDER BY RAND() LIMIT var1
If you're using DW 8.0.2 or CS3, define var1 as Numeric, and
set its
runtime value to $_POST['numQuestions'] or
$_GET['numQuestions'],
depending on whether you use POST or GET to pass the number
of questions
to the page.
There must be no space between RAND and the parentheses.
--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/