title: Unusual occurrence with database function
body: <p>I wrote a simple function to send some form values to a database and keep getting a syntax error that I can't seem to solve. I've tried 19 different variations of the code and still, I get the same error.</p>
  
  <pre><code>&lt;?php
  
      function sendData () {
      $con = mysql_connect("XXXXXXXXX","XXXXXXXXX","XXXXXXXXX");
      if (!$con)
          {
      die('Could not connect: ' . mysql_error());
          }
          mysql_select_db("user", $con);
          $name = mysql_real_escape_string($_POST['name'], $con);
          $age = mysql_real_escape_string($_POST['age'], $con);
          $phone = mysql_real_escape_string($_POST['phone'], $con);
          $email = mysql_real_escape_string($_POST['email'], $con);
          $revenue = mysql_real_escape_string($_POST['revenue'], $con);
          $expenses = mysql_real_escape_string($_POST['expenses'], $con);
          $marketing = mysql_real_escape_string($_POST['marketing'], $con);
          $advertising = mysql_real_escape_string($_POST['advertising'], $con);
          $sql = "INSERT into users (name, age, phone, email, revenue, expenses, marketing, advertising) VALUES ('$name', '$age', '$phone', '$email', '$revenue', '$expenses', '$marketing', '$advertising');
          mysql_query( $sql , $con );
          mysql_close($con);
          }
  
  
      sendData();
  ?&gt;
  </code></pre>