Jump to content

newbaba

New Members
  • Posts

    2
  • Joined

  • Last visited

newbaba's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks alot for your prompt reply will update and post it here if any issue again
  2. <?php print_r (" <form name=\"form1\" method=\"post\" action=\"quizt1a.php\"> <div align=\"center\"> <table width=\"699\" border=\"1\" cellspacing=\"1\" cellpadding=\"0\" bordercolor=\"#000000\">"); $servername = "localhost"; $username = "root"; $password = ""; $dbname = "quizdb"; // Create connection $conn = mysqli_connect($servername, $username, $password, $dbname); if (!$conn) { die("Connection failed: " . mysqli_connect_error()); //Get question Rows $sql = mysqli_query ("SELECT * FROM quizt1"); while ($row = mysqli_fetch_array($sql)) { $qno = $row["questionno"]; $question = $row["question"]; $qanswer1 = $row["answer1"]; $qanswer2 = $row["answer2"]; $qanswer3 = $row["answer3"]; $qanswer4 = $row["answer4"]; $qanswer5 = $row["answer5"]; print_r ("<tr> <td width=\"26\">$qno</td> <td width=\"360\">$question</td> <td width=\"281\"> <select name=\"question$qno\" class=\"formbox1\"> <option value=\"0\" selected>-- Answers --</option> <option value=\"1\">$qanswer1</option> <option value=\"2\">$qanswer2</option>"); if ($qanswer3 <> ""){ print_r "<option value=\"3\">$qanswer3</option>";}; if ($qanswer4 <> ""){ print_r "<option value=\"4\">$qanswer4</option>";}; if ($qanswer5 <> ''){ print_r "<option value=\"5\">$qanswer5</option>";}; { print_r "</select></td></tr>"; } print_r '$quizid'; } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.