title: Does an IF NOT EXISTS mySQL query exist?
body: <p>just doing an INSERT using mySQL which works fine...</p>
  
  <pre><code> mysql_query("INSERT INTO FLIGHTS_AVAILABLE 
   (aircraftID, aircraftType, maxSeats) VALUES('$theaircraftID', '$addType', '$maxCapacity'      ) ") 
  or die(mysql_error());  
  
   echo '&lt;p&gt;';
   echo "The following details were added into the database:";
   echo "&lt;hr&gt;";
  
    echo $theaircraftID . $addType . $maxCapacity;
  </code></pre>
  
  <p>This works fine, however I've looked online and whilst I have heard of a feature called IF NOT EXISTS, there are not very good explanations online about it's use.</p>
  
  <p>Is there anyway, I can run this query above, providing that if for example $theaircraftID = 10, and there is already a row in the database where the aircraftID = 10, then the query would not be run?</p>
  
  <p>Thanks for any help you may be able to suggest,</p>
  
  <p>Tom</p>