title: sql error while trying to store the image to database(UPDATED)
body: <p><code>UPDATED:</code> As suggested in comment section I have updated my code and using PDO now. I still have the same error.
  I am trying to store multiple images to the database (phpmyadmin). When I try to upload it gives an error <code>Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'file.png' in 'field list'</code></p>
  <p>My database:</p>
  <p>I have an database named  image_upload and inside it has a table named  car_detailss which has an id (int11), car_name(varchar 255) and imageOfcar(longblob).</p>
  <p>That's my image details:</p>
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [name] =&gt; file.png
              [type] =&gt; image/png
              [tmp_name] =&gt; /opt/lampp/temp/phpJYyrQn
              [error] =&gt; 0
              [size] =&gt; 77776
          )
  
      [1] =&gt; Array
          (
              [name] =&gt; files.png
              [type] =&gt; image/png
              [tmp_name] =&gt; /opt/lampp/temp/phpXOLvzL
              [error] =&gt; 0
              [size] =&gt; 84710
          )
  
  )
  </code></pre>
  <p>As suggested in comment section I am using PDO now
  That's my code: (UPDATED)</p>
  <pre><code>    &lt;!doctype html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Test&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;form   method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
             &lt;input type=&quot;file&quot; name=&quot;userfile[]&quot; multiple=&quot;&quot; /&gt; 
             &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;upload&quot; /&gt;
      &lt;/form&gt;
  
      &lt;?php
        $servername=&quot;localhost&quot;;
        $username=&quot;root&quot;;
        $password = &quot;&quot;;
        $dbname=&quot;image_upload&quot;;
        try {
        $conn = new PDO(&quot;mysql:host=$servername;dbname=$dbname&quot;,$username, $password);
        $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  
        // begin the transaction
        $conn-&gt;beginTransaction();
  
  
        
        
  
  $phpFileUploadErrors = array(
      0 =&gt; &quot;There is no error, the file uploaded with success&quot;,
      1 =&gt; &quot;The uploaded file exceeds the upload_max_filesize directive in php.ini&quot;,
  
      2 =&gt; &quot;The upload file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form&quot;,
  
      3 =&gt; &quot;The upload file was only partially uploaded&quot;,
  
  
      4 =&gt; &quot;No file was uploaded&quot;,
  
      6 =&gt; &quot;Missing a temporary folder&quot;,
      7 =&gt; &quot;Failed to write file to disk.&quot;,
      8 =&gt; &quot;A php extension stopped the file upload&quot;
  );
  
  
  
      if(isset($_FILES['userfile'])) {
        
         $file_array = reArrayFiles($_FILES['userfile']);
         pre_r($file_array);
          for($i=0;$i&lt;count($file_array);$i++) {
  
      $carname = $file_array[$i][&quot;tmp_name&quot;];
      $tablename = &quot;car_detailss&quot;;
  
              $imagename = $file_array[$i][&quot;name&quot;];
              pre_r($carname);
              pre_r($imagename);
              $conn-&gt;exec(&quot;INSERT INTO `car_detailss`(`car_name`, `imageOfcar`) VALUES ( $carname,$imagename)&quot;);
            
            
            
              }
             
           
           
  
          }
          $conn-&gt;commit();
          echo &quot;new records created succesfully&quot;;
      } catch(PDOException $e) {
          // roll back the transaction if something failed
          $conn-&gt;rollback();
          echo &quot;Error: &quot; . $e-&gt;getMessage();
        }
        
        $conn = null;
         
      
  
        
   
      
  
   function reArrayFiles($file_post) {
       $file_ary = array();
       $file_count = count($file_post['name']);
       $file_keys = array_keys($file_post);
  
       for ($i = 0; $i &lt; $file_count; $i++){
       foreach($file_keys as $key) {
           $file_ary[$i][$key] = $file_post[$key][$i];
       
       }
   }
   return $file_ary;
  }
  
      function pre_r($array) {
          echo '&lt;pre&gt;';
          print_r($array);
          echo '&lt;/pre&gt;';
      }
  
      
      ?&gt;
      
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>How can I fix the error it displays (at the top) I mentioned?</p>