title: Mysql insert query isn't working in php file?
body: <pre><code>&lt;?php
  error_reporting(0);
      $firstName = $_POST['firstName'];
      $lastName = $_POST['lastName'];
      $gender = $_POST['gender'];
      $email = $_POST['email'];
      $password = $_POST['password'];
  
      // Database connection
      $conn = new mysqli('localhost','root','','farming');
      if($conn-&gt;connect_error){
          echo &quot;$conn-&gt;connect_error&quot;;
          die(&quot;Connection Failed : &quot;. $conn-&gt;connect_error);
      } else {
          echo &quot;connection ok&quot;; 
          $stmt = $conn-&gt;prepare(&quot;insert into registration(firstName, lastName, gender, email, password, phone) values( ?, ?, ?, ?, ?)&quot;);
          $stmt-&gt;bind_param(&quot;sssss&quot;, $firstName, $lastName, $gender, $email, $password);
          $stmt= $stmt-&gt;execute();
          echo &quot;Registration successfully...&quot;;
          $stmt-&gt;close();
          $conn-&gt;close();
      }
  ?&gt;
  </code></pre>
  <p>I am new to php and trying to insert some values to my database table but query isn't working when I am passing values by php variables. This query was working properly manually but not in php form</p>