title: using php to enter data into mysql database in wordpress
body: <p>I'm currently trying to enter data from a form in a wordpress web page into a mysql database.</p>
  
  <p>here is the code from the html page on wordpress</p>
  
  <pre><code>&lt;table&gt;
  &lt;form name="form1" method="post" action="basisForm.php"&gt;
  &lt;strong&gt;Please enter your information in order to download the Macs Cabs App&lt;/strong&gt;
  &lt;tr&gt;&lt;td&gt;
  Surmane Name:&lt;/td&gt;&lt;td&gt;&lt;input name="sname" type="text" id="sname"&gt;&lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;td&gt;
  First Name:&lt;/td&gt;&lt;td&gt;&lt;input name="fname" type="text" id="fname"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
  Home Address:&lt;/td&gt;&lt;td&gt;&lt;input name="homeaddr" type="text" id="homeaddr"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
  Most common Destination:&lt;/td&gt;&lt;td&gt;&lt;input name="commondest" type="text" id="commondest"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
  Mobile Number:&lt;/td&gt;&lt;td&gt;&lt;input name="mobileno" type="text" id="mobileno"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
  Home Number:&lt;/td&gt;&lt;td&gt;&lt;input name="homeno" type="text" id="homeno"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
  Email Address:&lt;/td&gt;&lt;td&gt;&lt;input name="email" type="text" id="email"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
  &lt;input type="submit" name="Submit" value="Submit"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/form&gt;
  &lt;/table&gt;
  
  &lt;?php
  $con = mysql_connect("localhost","root","");
  if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  
   mysql_select_db("macs cabs", $con);
  
  $sql="INSERT INTO customers (sname, fname, homeaddr, commondest, mobileno, homeno, email)
  VALUES
    ('$_POST[sname]','$_POST[fname]','$_POST[homeaddr]','$_POST[commondest]','$_POST[mobileno]','$_POST[     homeno]','$_POST[email]')";          
  
  
  
  
  if (!mysql_query($sql,$con))
   {
   die('Error: ' . mysql_error());
    }
   echo "1 record added";
  
   mysql_close($con);
  ?&gt; 
  </code></pre>
  
  <p>i have installed the phpexec plugin and that seems to be runing fine.</p>
  
  <p>when i enter data in the form and i submit it doesnt appear in the database.</p>
  
  <p>My primary key seems to auto increment telling me something happened but no data appears.</p>
  
  <p>thanks in advance</p>