title: Insert Query If Statement PHP
body: <p>I created a process form that inserts values from one php page into the database. I would like to email the results of the form to several users using some type of authentication method. I thought I could achieve this with <code>mysql_query()</code>, but it plugs in the data, but isn't sending a email.</p>
  
  <pre><code>$sql = insert query
  $connection = mysql_connect
  </code></pre>
  
  <p>I used:</p>
  
  <pre><code>if (!mysql_query($sql,$connection))
   {
       die('Error' . mysql_error());
   }
  </code></pre>
  
  <p>I tried to insert <code>mail()</code> after the if statement, but it doesn't work. If I insert <code>mail()</code> after the die statement anyone is able to process the file and send emails. How can I get this to work? Any help is appreciated.</p>