title: Error: Champ 'product_name' inconnu dans field list
body: <p>I am trying to store form data in a database using WampServer.</p>
  
  <p>When I click on the submit button it shows me this error: </p>
  
  <pre><code>"Error: Champ 'product_name' inconnu dans field list".
  </code></pre>
  
  <p>I am using the same work for another form. That form is working but i dont know what is wrong with this one, Please help me out </p>
  
  <p>My form code is : </p>
  
  <pre><code>&lt;form action="saddproduct.php" enctype="multipart/form-data" name="myForm" id="myForm" 
   method="post"&gt; 
      &lt;table width="90%" border="1" cellpadding="6"&gt;
          &lt;tr&gt;
              &lt;td width="20%"&gt;Product Name&lt;/td&gt;
              &lt;td width="80%"&gt; 
                  &lt;label&gt; 
                  &lt;input name="product_name" type="text" id="product_name" size="60" /&gt; 
              &lt;/label&gt;    
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width="20%"&gt;Product Code&lt;/td&gt;
              &lt;td width="80%"&gt; 
                  &lt;label&gt; 
                      &lt;input name="product_code" type="text" id="product_code" size="60" /&gt; 
                  &lt;/label&gt;    
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width="20%"&gt;Product Availability&lt;/td&gt;
              &lt;td width="80%"&gt; 
              &lt;label&gt;
                  &lt;select name="availability" id="availability"&gt;
                      &lt;option value=""&gt;&lt;/option&gt;
                      &lt;option value="in"&gt; In Stock &lt;/option&gt;
                      &lt;option value="out"&gt; Out Of Stock &lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/label&gt;    
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width="20%"&gt;Product Price&lt;/td&gt;
              &lt;td width="80%"&gt;
              &lt;label&gt;
                  Rs.
                  &lt;input name="price" type="text" id="price" size="12"  /&gt;
              &lt;/label&gt;    
              &lt;/td&gt;
           &lt;/tr&gt;
           &lt;tr&gt;
               &lt;td align="right"&gt;Category&lt;/td&gt;
              &lt;td&gt;
          &lt;label&gt;
                  &lt;select name="category" id="category"&gt;
                      &lt;option value=""&gt;&lt;/option&gt;
                      &lt;option value="living"&gt; Living Rooms &lt;/option&gt;
                      &lt;option value="bed"&gt; Bed Rooms &lt;/option&gt;
                      &lt;option value="dining"&gt; Dining Rooms &lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/label&gt;    
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td align="right"&gt;Sub category&lt;/td&gt;
              &lt;td&gt;
                  &lt;label&gt;
                      &lt;select name="subcategory" id="subcategory"&gt;
                          &lt;option value=""&gt;&lt;/option&gt;
                          &lt;option value="lsofa"&gt; Lining Sofa &lt;/option&gt;
                          &lt;option value="lchair"&gt; Living Chair &lt;/option&gt;
                          &lt;option value="ltable"&gt; Living Table &lt;/option&gt;
                          &lt;option value="bking"&gt; King Beds &lt;/option&gt;
                          &lt;option value="bqueen"&gt; Queen Beds &lt;/option&gt;
                          &lt;option value="dtable"&gt; Dining Tables &lt;/option&gt;
                          &lt;option value="dchairs"&gt; Dining Chairs &lt;/option&gt;
                          &lt;option value="hsale"&gt; Sale Item For Home Page &lt;/option&gt;
                          &lt;option value="psale"&gt; Sale Item For Sale Page &lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/label&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width="20%"&gt;Product Detail&lt;/td&gt;
              &lt;td width="80%"&gt;
              &lt;label&gt;
                  &lt;textarea name="details" id="details" cols="64" rows="5"&gt; &lt;/textarea&gt;
              &lt;/label&gt;    
              &lt;/td&gt;
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;td&gt;&amp;nbsp;  &lt;/td&gt;
              &lt;td width="80%"&gt; 
                  &lt;label&gt; 
                      &lt;input type="submit" name="button" id="button" class="button" value="Add This  
           Product Now"  /&gt;
                  &lt;/label&gt;    
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width="20%"&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td width="80%"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;/tr&gt;
     &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And my processing PHP page is saddproduct.php which look like :</p>
  
  <pre><code>&lt;?php
      $con=mysqli_connect("localhost","root","03005225400","furniture");
      // Check connection
      if (mysqli_connect_errno()) {
          echo "Failed to connect to MySQL: " . mysqli_connect_error();
      }
  
  
      // escape variables for security
      $product_name = mysqli_real_escape_string($con, $_POST['product_name']);
      $product_code = mysqli_real_escape_string($con, $_POST['product_code']);
      $availability = mysqli_real_escape_string($con, $_POST['availability']);
  
      $price = mysqli_real_escape_string($con, $_POST['price']);
      $category = mysqli_real_escape_string($con, $_POST['category']);
      $subcategory = mysqli_real_escape_string($con, $_POST['subcategory']);
  
      $details = mysqli_real_escape_string($con, $_POST['details']);
  
  
      $sql="INSERT INTO employee 
                (product_name , product_code, availability, price, 
                 category, subcategory, details, date_added) 
            VALUES('$product_name','$product_code', '$availability',     
                  '$price','$category','$subcategory','$details',now())" 
            or die (mysql_error());
  
      if (!mysqli_query($con,$sql)) {
        die('Error: ' . mysqli_error($con));
      }
  
      mysqli_close($con);
  ?&gt;
  </code></pre>