title: I have a quiz and I want to get random questions (no repeat)
body: <p>As the title said, I have a huge problem with a PHP script. I want to extract(Get) random questions from my database and after that display it.I want the script to look like here: <a href="http://www.filebox.ro/download.php?key=d07a7jdcf2ouwu62" rel="nofollow">http://www.filebox.ro/download.php?key=d07a7jdcf2ouwu62</a>
  but with a MySQL database, and a admin dashboard for administrating questions and users.
  Here is my script: <a href="http://fbx.ro/hxsztelz2chq1ekk" rel="nofollow">http://fbx.ro/hxsztelz2chq1ekk</a></p>
  
  <p>Here is my index.php
  As you see on line 6 I don't know how to do it...
  If you can teach me how to extract more than 1 question, like a quiz (aprox.:20 random questions)</p>
  
  <pre><code> &lt;?php
  include("config.php");
  ?&gt;
  &lt;?php
  session_start();
  $sql = "select * from quiz order by rand() LIMIT 1";
  $result = mysql_query($sql);
  $row = mysql_fetch_object($result);
  $question = "$row-&gt;questions";
  $correctanswer = "$row-&gt;answers";
  $money = '1';
  $today = date('Y-m-d');
  if (isset($_POST['submitted'])) {
  if (empty($_POST['answer']) || empty($_POST['id'])) {
  echo '&lt;p&gt;&lt;span style="color: red;"&gt;Trebuie sa introduci un raspuns!&lt;/span&gt;&lt;/p&gt;';
  } else {
  
  $answer = $_POST['answer'];
  $sql_answer = "select * from quiz where id = '".addslashes($_POST["id"])."'";
  $result1 = mysql_query($sql_answer);
  $row1 = mysql_fetch_object($result1);
  $correctanswer = $row1-&gt;answers;
  if (strtolower($answer) == strtolower($correctanswer))
  {
  echo 'Bravo, ai raspuns corect!';
  $sql3= "INSERT INTO money VALUES ('','$money','$today')";
  $res3 = mysql_query($sql3);
  }
  elseif (strtolower($answer) != strtolower($correctanswer)){
  
  echo 'Raspuns gresit! Raspunsul corect era '.$correctanswer.'.';
  }
  }
  }
  ?&gt;
  &lt;form action="&lt;?php $_SERVER['PHP_SELF'] ?&gt;" method="post"&gt;
  &lt;?php echo "Intrebare: $question"; ?&gt;
  &lt;br&gt;
  Raspuns: &lt;input maxlength="60" name="answer" size="25" type="input"&gt;
  &lt;input name="id" type="hidden" value="&lt;?php echo $row-&gt;id ?&gt;"&gt;
  &lt;input name="submit" type="submit" value="Go"&gt;
  &lt;input name="submitted" type="hidden" value="TRUE"&gt;
  &lt;/form&gt;
  
  
  
  REZULTATE:
  &lt;?php
  $query1="SELECT money, data, Sum(money) AS SumOfMoney FROM money GROUP BY DATE_FORMAT(data, '%M %d, %Y') = NOW()";
  $result1=mysql_query($query1);
  $row1=mysql_fetch_assoc($result1);
  echo '&lt;br&gt;Total: '.$row1['SumOfMoney'].' puncte
  
  ';
  ?&gt;
  </code></pre>