title: PHP and SQL returning duplicate results
body: <p>I am trying create a order history page. An SQL statement that finds all the applications based on a order_ID in an orderdetails_tbl. Here is the SQL.</p>
  
  <pre><code>SELECT * FROM applications_tbl INNER JOIN orderdetails_tbl ON orderdetails_tbl.app_ID = applications_tbl.app_ID WHERE orderdetails_tbl.order_ID = $orderID
  </code></pre>
  
  <p>The results are displayed using this PHP.</p>
  
  <pre><code>$result = mysql_query("SELECT * 
  FROM applications_tbl
  INNER JOIN orderdetails_tbl ON orderdetails_tbl.app_ID = applications_tbl.app_ID WHERE orderdetails_tbl.order_ID = ".$order_ID."");
  $row = mysql_fetch_assoc($result);
  echo "&lt;table&gt;";
  do { ?&gt;
  
      &lt;tr style="background-color:#fff"&gt;
      &lt;td&gt; &lt;img src="getimage.php?ID=&lt;?php echo $row['app_ID']; ?&gt;" width="100" height="100" alt="IMAGE" /&gt;&lt;/td&gt;
             &lt;td width="20%"&gt;&lt;?php echo $row['app_name']; ?&gt;&lt;/td&gt;
             &lt;td&gt;&lt;?php echo $row['app_desc']; ?&gt;&lt;/td&gt;
             &lt;td width="15%"&gt;&lt;?php echo $row['app_cost']; ?&gt;&lt;/td&gt;
       &lt;/tr&gt;    
       &lt;?php  
   } while ($row = mysql_fetch_assoc($result)); 
  </code></pre>
  
  <p>The SQL returns the correct values and the PHP displays them correctly. My issue is that it on the webpage it returns many duplicate results. It appears to be random, but I noticed the more apps/items in the order the more duplicate results. In phpMyAdmin when I run the SQL it doesn't display duplicates. </p>
  
  <p>Cheers for your time. Any advice will be greatly received! </p>