" . mysql_errono() . ": " . mysql_error() . "
"); if (mysql_numrows($result) != 1) { print "

Sorry, but there no such question was found in our database..."; print "

That means there's a problem with the system: please contact the web master so it can be fixed quickly!"; } else { $title = stripslashes(mysql_result($result, 0, "title")); $questionName = stripslashes(mysql_result($result, 0, "name")); $question= stripslashes(mysql_result($result, 0, "question")); $questionEmail = replaceAtSymbols(mysql_result($result, 0, "email")); $entryDate = FormatTheDate(mysql_result($result, 0, "entryDate"), 3); // Each complete question (with all its answers) is a separate table.... print(" \n"); print("\t \n"); // NOW WE NEED TO DISPLAY ANY ANSWERS !!! $query = "SELECT * FROM answers WHERE (questionID = $questionID) ORDER BY entryDate"; $answerResult = mysql_query($query); if (mysql_errno()) { die("
" . mysql_errono() . ": " . mysql_error() . "
"); } $numAnswers = mysql_numrows($answerResult); $ans=0; while ($ans < $numAnswers) { $answer = stripslashes(mysql_result($answerResult, $ans, "answer")); $answerName = stripslashes(mysql_result($answerResult, $ans, "name")); $answerEmail = replaceAtSymbols(mysql_result($answerResult, $ans, "email")); $answerDate = FormatTheDate(mysql_result($answerResult, $ans, "entryDate"), 3); print("\t \n"); print("\t \n"); ++$ans; } print("\t \n"); // blank row for spacing print("
"); print("$questionName"); if (strlen($questionEmail)>0) print(" ($questionEmail)"); print(" asks:     [$entryDate]
\n"); print("\t$title
\n"); print("\t

$question \n"); print("

  On $answerDate $answerName"); if (strlen($answerEmail)>0) print(" ($answerEmail)"); print(" says:
\n"); print("\t

$answer

 
\n\n"); } // Let user select the next entry if they want to... //$query="SELECT * FROM questions WHERE (id<$questionID) ORDER BY id DESC"; //$result = mysql_query($query); //if (mysql_errno()) die("
" . mysql_errono() . ": " . mysql_error() . "
"); //if (mysql_numrows($result) > 0) //{ // $nextID = mysql_result($result, 0, "id"); // $title = stripslashes(mysql_result($result, 0, "title")); // print("

Next question: — $title...\n"); //} mysql_close(); } ?>