Click here to Skip to main content
15,886,873 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: image preview and save to a folder Pin
ZurdoDev24-Feb-15 11:01
professionalZurdoDev24-Feb-15 11:01 
AnswerRe: image preview and save to a folder Pin
Afzaal Ahmad Zeeshan28-Feb-15 22:06
professionalAfzaal Ahmad Zeeshan28-Feb-15 22:06 
GeneralRe: image preview and save to a folder Pin
Afzaal Ahmad Zeeshan16-Jun-15 5:43
professionalAfzaal Ahmad Zeeshan16-Jun-15 5:43 
GeneralRe: image preview and save to a folder Pin
Simewu16-Jun-15 12:08
professionalSimewu16-Jun-15 12:08 
AnswerRe: image preview and save to a folder Pin
Simewu16-Jun-15 12:09
professionalSimewu16-Jun-15 12:09 
Questionauto submit form Pin
joe-hanh24-Feb-15 6:22
joe-hanh24-Feb-15 6:22 
AnswerRe: auto submit form Pin
Afzaal Ahmad Zeeshan24-Feb-15 6:47
professionalAfzaal Ahmad Zeeshan24-Feb-15 6:47 
GeneralRe: auto submit form Pin
joe-hanh25-Feb-15 2:31
joe-hanh25-Feb-15 2:31 
can you please elaborate by putting the code in the correct place






query($query) or die($mysqli->error.__LINE__);
$total = $results->num_rows;

//get a random question
if (empty($_SESSION['questionsUsed']))
{$questionSet = "SELECT * FROM `questions` ORDER BY RAND() LIMIT 1";}
else if ($total>count($_SESSION['questionsUsed'])) //there are more questions that haven't been asked
{
$questionsUsed = implode(',', $_SESSION['questionsUsed']);//join the array
$questionSet = "SELECT * FROM `questions` WHERE question_number not in ($questionsUsed)ORDER BY RAND() LIMIT 1";//get a random question that hasn't already been answered
}
else
{header("Location: final.php");
exit();}
$result = $mysqli->query($questionSet) or die($mysqli->error.__LINE__);
$question = $result->fetch_assoc();

//get random number
$random = $question['question_number'];
$_SESSION['questionsUsed'][] = $random;//add the question number to the list of questions asked

//get choices
$query = "SELECT * FROM `choices`
WHERE question_number = $random";

//get results
$choices = $mysqli->query($query) or die($mysqli->error.__LINE__);
?>



<title>PHP Quizzer




PHP Quizzer







Question of






    fetch_assoc()) : ?>









Copyright © Joe




QuestionGet selected Li from UL Pin
indian14323-Feb-15 15:02
indian14323-Feb-15 15:02 
AnswerRe: Get selected Li from UL Pin
Matt U.24-Mar-15 9:59
Matt U.24-Mar-15 9:59 
AnswerRe: Get selected Li from UL Pin
Simewu15-Jun-15 15:23
professionalSimewu15-Jun-15 15:23 
QuestionHiding a button which doesn't have an ID or Name Pin
indian14322-Feb-15 8:52
indian14322-Feb-15 8:52 
SuggestionRe: Hiding a button which doesn't have an ID or Name Pin
Kornfeld Eliyahu Peter23-Feb-15 6:07
professionalKornfeld Eliyahu Peter23-Feb-15 6:07 
GeneralRe: Hiding a button which doesn't have an ID or Name Pin
indian14323-Feb-15 12:05
indian14323-Feb-15 12:05 
AnswerRe: Hiding a button which doesn't have an ID or Name Pin
enhzflep27-Feb-15 5:48
enhzflep27-Feb-15 5:48 
QuestionNew to JQuery Pin
indian14319-Feb-15 9:08
indian14319-Feb-15 9:08 
AnswerRe: New to JQuery PinPopular
Richard MacCutchan19-Feb-15 21:30
mveRichard MacCutchan19-Feb-15 21:30 
GeneralRe: New to JQuery Pin
indian14320-Feb-15 11:35
indian14320-Feb-15 11:35 
GeneralRe: New to JQuery Pin
Richard MacCutchan20-Feb-15 21:47
mveRichard MacCutchan20-Feb-15 21:47 
GeneralRe: New to JQuery Pin
Amarnath S23-Feb-15 5:29
professionalAmarnath S23-Feb-15 5:29 
QuestionGetting text from UL using jquery Pin
indian14319-Feb-15 8:55
indian14319-Feb-15 8:55 
AnswerRe: Getting text from UL using jquery Pin
Dennis E White20-Feb-15 4:56
professionalDennis E White20-Feb-15 4:56 
QuestionI want to move slider/carousel automatically without clicking first to start Pin
Member 1048773918-Feb-15 9:31
Member 1048773918-Feb-15 9:31 
AnswerRe: I want to move slider/carousel automatically without clicking first to start Pin
ZurdoDev19-Feb-15 4:18
professionalZurdoDev19-Feb-15 4:18 
AnswerRe: I want to move slider/carousel automatically without clicking first to start Pin
Santosh K. Tripathi31-Mar-15 1:59
professionalSantosh K. Tripathi31-Mar-15 1:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.