title: mysql error during inserting a image in mysql database
body: <p>I am working on a website and my task is to take product image from user and store that image in the database..i am using mysql database.
  My code for html form is as:-</p>
  
  <pre><code>      &lt;FORM action="testimage1.php" ENCTYPE="multipart/form-data" method="post"&gt;
                &lt;div style="font:bold 10px arial,serif;" &gt;Product Name*&lt;/div&gt;
                &lt;input type="text" name="myuserName" maxlength="50" /&gt;&lt;br /&gt;
               &lt;div style="font:bold 10px arial,serif;" &gt;Upload a photo&lt;/div&gt;
                 &lt;input name="uploadimage" type="file" /&gt;&lt;/br&gt;
                &lt;div style="font:bold 10px arial,serif;"&gt;Product Description:&lt;/div&gt; 
                &lt;input type="text" name="product" value=""&gt;&lt;/br&gt;
                &lt;input id="submit" type="submit" value="submit" /&gt;&lt;br /&gt;
       &lt;/FORM&gt;
  </code></pre>
  
  <p>My code for testimage1.php is as:-</p>
  
  <pre><code>           require_once("dbconnect.inc.php");                       
      $db_name="thinstrokes";                                     //for localhost databasename
       $tbl_name="product";
       $db_selected=mysql_select_db("$db_name")or die("cannot select DB");
  
      $myusername=$_POST['myusername']; 
      $mypassword=$_POST['product'];
      $filename=$_FILES['uploadimage']['tmp_name']; 
      $imgData = file_get_contents($filename);
      $size = getimagesize($filename);
      $sql = "INSERT INTO product
      (productname, image_id , image_type ,image, image_size, image_name,   productdesc)VALUES
      ('$myusername','11', '{$size['mime']}', '{$imgData}', '{$size[3]}', 
       '{$_FILES['userfile']['name']}','$productdesc')";
      $result=mysql_query($sql) or die("error in uploading/*");
  </code></pre>
  
  <p>and i am getting an error as:-error in uploading/*
  how can i correct it?</p>