title: Unable to insert form data in MySQL database
body: <p>I am using following php script to insert data in my MySQL database.But no rows are getting inserted..when I run same sql query in phpmyadmin its working fine.</p>
  
  <pre><code>&lt;?php
  
  if(isset($_POST['submit']) &amp;&amp; isset($_POST['Pnr']) &amp;&amp; isset($_POST['Mobile']))
  
  {
      $hostname = "";
      $username = "";
      $password = "";
      $Pnr = $_POST['Pnr'];
      $Mobile = $_POST['Mobile'];
  
      $con = mysql_connect($hostname,$username,$password);
  
  if(!$con)
  {
      die("Could not connect to Database");
  }
  
      mysql_select_db("freepnra_userinfo",$con);
  
      $sql = "INSERT INTO users (pnr,mobile) VALUES ('$Pnr','$Mobile')";
  
      mysql_query($sql) or die("insertion error");
  }
  
  ?&gt;  
  </code></pre>