title: In Php to dynamically get table name and fields from csv file and import to MYSQL
body: <p>I have created a data-structure in Mysql with table name(CSV filename) and field names(CSV column names).</p>
  
  <p>Right now I am importing the data from csv to Mysql table successfully Where as I am hard-coding csv file name and field name in script. How to dynamical fetch bec I have manny csv files to import into mysql.</p>
  
  <pre><code>&lt;?php
  include "db.php";
  $filename = "C:\REQ\Status.csv";
  if (($handle = fopen($filename, 'r')) !== FALSE)
       while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
       {
         print_r($data);
         $import="INSERT into status(status) values('$data[1]')";
         mysql_query($import) or die(mysql_error());
  
       }
   fclose($handle);
  
  ?&gt;    
  </code></pre>