title: Adding data through php into sql
body: <p>Can anyone help me with this, i have checked the SQL table names multiple times but every time i attempt to post it gives me an error. Pretty new to this. Thanks in advance.   </p>
  
  <pre><code>  require_once('connect.php');
  
  if (isset($_POST['add_product'])):
  $product_description=$_POST['product_description'];
  $price=$_POST['price'];
  $reorder_level=$_POST['reorder_level'];
  $current_level=$_POST['current_level'];
  
  $imagename = $_FILES['image']['name'];
  $add_this = "products/$imagename";
  move_uploaded_file($_FILES['image']['tmp_name'],$add_this);
  
  $my_query="INSERT INTO products VALUES ('','$product_description','$price','$reorder_level','$current_level', '$imagename')";
  
  $result= mysqli_query($connection, $my_query);
  
  if ($result):
      echo "&lt;b&gt;Item Successfully Added!&lt;/b&gt;";
      echo "File ";
      echo $_FILES['image']['name'];
      echo " was uploaded - ";
      echo $_FILES['image']['size'];
      echo " bytes in size&lt;br&gt;Temporary name: ";
      echo $_FILES['image']['tmp_name'];
      echo " - file type: ";
      echo $_FILES['image']['type'];
  
  else:
      echo "&lt;b&gt;ERROR: unable to post.&lt;/b&gt;";
  endif;
  
   endif;
  
  require_once 'header1.php'; 
   ?&gt;
  </code></pre>
  
  <p>Here is the form im using </p>
  
  <pre><code>     &lt;H1&gt;Add a New Product&lt;/H1&gt;
   &lt;table&gt;
  &lt;form method=post action="addproduct.php" enctype="multipart/form-data"&gt;
  &lt;tr&gt;&lt;td&gt;&lt;b&gt;Product Description:&lt;/b&gt;&lt;td&gt;&lt;input type="text" name="product_description" size="30"&gt;
  &lt;tr&gt;&lt;td&gt;&lt;b&gt;Price:&lt;/b&gt;&lt;td&gt;&lt;input type="text" name="price"&gt; 
  &lt;tr&gt;&lt;td&gt;&lt;b&gt;Re Order Level:&lt;/b&gt;&lt;td&gt;&lt;input type="text" name="reorder_level"&gt;
  &lt;tr&gt;&lt;td&gt;&lt;b&gt;Stock Level:&lt;/b&gt;&lt;td&gt;&lt;input type="text" name="current_level"&gt; 
  &lt;tr&gt;&lt;td&gt;&lt;b&gt;Add Image:&lt;/b&gt;&lt;td&gt;&lt;input type="file" name="image"&gt;
  &lt;tr&gt;&lt;td&gt;&lt;input type="submit" name="add_product" &gt;
  &lt;/form&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>