PHP : You have an error in your SQL syntax check the manual
<p>I am trying to insert data by submitting form and this is the error that I get </p>

<pre><code>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc,refno,quantity,imgname, image) 
VALUES('name','Some desc ', '123','123' at line 1
</code></pre>

<p>following is my sql query </p>

<pre><code>$query= mysqli_query($connect,
     "INSERT INTO products(name,desc,refno,quantity) 
      VALUES('$names','$productdesc', '$refno','$quanitity')");
</code></pre>

<p>Following is the attached screenshot for db 
<a href="https://i.stack.imgur.com/rcwSa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rcwSa.png" alt="enter image description here"></a></p>

<p>if I call <code>print_r</code> this is what I get </p>

<pre><code>Array
(
    [name] =&gt; name
    [refno] =&gt; 123
    [quantity] =&gt; 123456
    [description] =&gt; Some desc 
    [submit] =&gt; Add Product
)
</code></pre>