Note that there are some explanatory texts on larger screens.

plurals
  1. POColumn count doesn't match value count at row 1 (Image Upload Error)
    primarykey
    data
    text
    <p>I'm having a problem when trying to upload images to a file and getting the above error. This code allows me to add new products to a store, they will update on the database with the file names it's just that they don't uploaded to the folder. Any help would be greatly appreciated.</p> <pre><code>&lt;?php include('../connect.php'); $addid= $_POST['addrow']; $addproduct= mysql_real_escape_string(htmlentities($_POST['addproduct'])); $addprice= mysql_real_escape_string(htmlentities($_POST['addprice'])); $addprevprice= mysql_real_escape_string(htmlentities($_POST['addprevprice'])); $adddetails= mysql_real_escape_string(htmlentities($_POST['adddetails'])); $addimage1 = mysql_real_escape_string($_FILES['addimage1']['name']); $addimage1temp = mysql_real_escape_string($_FILES['addimage1']['tmp_name']); $addimage1type = mysql_real_escape_string($_FILES['addimage1']['type']); $addimage1size = mysql_real_escape_string($_FILES['addimage1']['size']); $addimage2 = mysql_real_escape_string($_FILES['addimage2']['name']); $addimage2temp = mysql_real_escape_string($_FILES['addimage2']['tmp_name']); $addimage2type = mysql_real_escape_string($_FILES['addimage2']['type']); $addimage2size = mysql_real_escape_string($_FILES['addimage2']['size']); $addimage3 = mysql_real_escape_string($_FILES['addimage3']['name']); $addimage3temp = mysql_real_escape_string($_FILES['addimage3']['tmp_name']); $addimage3type = mysql_real_escape_string($_FILES['addimage3']['type']); $addimage3size = mysql_real_escape_string($_FILES['addimage3']['size']); if (!empty($addimage1)) { if ($addimage1type == 'image/gif' || $addimage1type == 'image/jpg' || $addimage1type == 'image/jpeg' &amp;&amp; $addimage1size &gt; 0 &amp;&amp; $addimage1size &lt; 2000000) { move_uploaded_file($addimage1temp,"../img/camera/$addimage1"); $query = "INSERT INTO admincamera (product, price, prevprice, details, image1)"."VALUES('$addproduct', '$addprice', '$addprevprice', '$adddetails', '$addimage1')"; } else { echo "&lt;p&gt;file needs to be a jpg/gif or file size too big.&lt;/p&gt;"; die(); } } else { $query = "INSERT INTO admincamera (product, price, prevprice, details)"."VALUES('$addproduct', '$addprice', '$addprevprice', '$adddetails')"; } mysql_query($query) or die(mysql_error()); if (!empty($addimage2)) { if ($addimage2type == 'image/gif' || $addimage2type == 'image/jpg' || $addimage2type == 'image/jpeg' &amp;&amp; $addimage2size &gt; 0 &amp;&amp; $addimage2size &lt; 2000000) { move_uploaded_file($addimage2temp,"../img/camera/$addimage2"); $query = "INSERT INTO admincamera (product, price, prevprice, details, image2)"."VALUES('$addproduct', '$addprice', '$addprevprice', '$adddetails', '$addimage2')"; } else { echo "&lt;p&gt;file needs to be a jpg/gif or file size too big.&lt;/p&gt;"; die(); } } else { $query = "INSERT INTO admincamera (product, price, prevprice, details)"."VALUES('$addproduct', '$addprice', '$addprevprice', '$adddetails')"; } mysql_query($query) or die(mysql_error()); if (!empty($addimage3)) { if ($addimage3type == 'image/gif' || $addimage3type == 'image/jpg' || $addimage3type == 'image/jpeg' &amp;&amp; $addimage3size &gt; 0 &amp;&amp; $addimage3size &lt; 2000000) { move_uploaded_file($addimage3temp,"../img/camera/$addimage3"); $query = "INSERT INTO admincamera (product, price, prevprice, details, image3)"."VALUES('$addproduct', '$addprice', '$addprevprice', '$adddetails' '$addimage3')"; } else { echo "&lt;p&gt;file needs to be a jpg/gif or file size too big.&lt;/p&gt;"; die(); } } else { $query = "INSERT INTO admincamera (product, price, prevprice, details)"."VALUES('$addproduct', '$addprice', '$addprevprice', '$adddetails')"; } mysql_query($query) or die(mysql_error()); mysql_close(); </code></pre> <p>?></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload