title: fetching two elements instead of one
body: <p>the table looks like this: </p>
  
  <p>id -- questions -- test_name</p>
  
  <p>1  --  Number 1 --  Prelim</p>
  
  <p>2  --  Number 2 -- Prelim</p>
  
  <p>3  --  Number 3 -- Prelim</p>
  
  <p>4  --  Number 4 -- Prelim</p>
  
  <p>1  --  Number 1 -- Midterm</p>
  
  <p>2  --  Number 2 -- Midterm</p>
  
  <p>3  --  Number 3 -- Midterm</p>
  
  <p>4  --  Number 4 -- Midterm</p>
  
  <p>first, the tables in the database where the id is not auto-incremented but instead for every major exams (prelim, midterm) the id is repeated as 1,2,3,4 which is equivalent to the number of questions per major exams.</p>
  
  <p>the problem is that when we fetch only 1 element, let's say for PRELIM, with id = "1", the Midterm with id= "1" also appears. how do I omit the midterm?</p>
  
  <p>the query code:</p>
  
  <pre><code>    $id=$_GET['id'];
  
      $result = mysql_query("SELECT * FROM paper WHERE id = '$id' and test_name='$test_name'");
  </code></pre>
  
  <p>I hope u understand my problem.</p>
  
  <p><a href="https://i.stack.imgur.com/iQUPX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iQUPX.jpg" alt="enter image description here"></a></p>