title: Importing CSV to MySQL database
body: <p>I'm trying to import a csv to a mysql table in my db but I keep getting this error:</p>
  
  <blockquote>
    <p>Unknown column '' in 'field list'</p>
  </blockquote>
  
  <pre><code>INSERT INTO `job_budget_report` (`Job_Num`, `Description`, `EngWeekly`, `EngTTD`, `EngBudget`, `DesignWeekly`, `DesignTTD`, `DesignBudget`, `DetailsWeekly`, `DetailsTTD`, `DetailsBudget`, `EjectionWeekly`, `EjectionTTD`, `EjectionBudget`, `CarbonEDMWeekly`, `CarbonEDMTTD`, `CarbonEDMBudget`, `GdrillBMWeekly`, `GdrillBMTTD`, `GdrillBMBudget`, `CNCWeekly`, `CNCTTD`, `CNCBudget`, `MMQCOtherWeekly`, `MMQCOtherTTD`, `MMQCOtherBudget`, `SpottingWeekly`, `SpottingTTD`, `SpottingBudget`, `SpotPLWeekly`, `SpotPLTTD`, `SpotPLBudget`, `HWWeekly`, `HWTTD`, `HWBudget`, `TotalMach`, `TotalOther`, `TotalOFMach`, ``) VALUES
  ('1000', 'description text here', '0', '0', '0', NULL, '0', '0', NULL, NULL, '0', NULL, '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '0', '20.5', '0', '0', '0', '0', '0', '18.5', '40', '0', '0', '0', '0', '0', '0', '0', '');
  </code></pre>
  
  <p>Table Structure:</p>
  
  <p><a href="http://imgur.com/rFLw4c7" rel="nofollow">http://imgur.com/rFLw4c7</a></p>
  
  <p>Now I realize that theres extra empty fields in that query but how do I remove them from my csv ? </p>
  
  <p>Here's what my csv looks like when I open it in sublime text:</p>
  
  <blockquote>
    <p>Job_Num;Description;EngWeekly;EngTTD;EngBudget;DesignWeekly;DesignTTD;DesignBudget;DetailsWeekly;DetailsTTD;DetailsBudget;EjectionWeekly;EjectionTTD;EjectionBudget;CarbonEDMWeekly;CarbonEDMTTD;CarbonEDMBudget;GdrillBMWeekly;GdrillBMTTD;GdrillBMBudget;CNCWeekly;CNCTTD;CNCBudget;MMQCOtherWeekly;MMQCOtherTTD;MMQCOtherBudget;SpottingWeekly;SpottingTTD;SpottingBudget;SpotPLWeekly;SpotPLTTD;SpotPLBudget;HWWeekly;HWTTD;HWBudget;TotalMach;TotalOther;TotalOFMach
    5710;GM K2XL Bracket FRT 5/D Belt
    R;0;0;0;;0;0;;;0;;0;;0;0;0;0;0;0;0;0;0;20.5;0;0;0;0;0;18.5;40;0;0;0;0;0;0;0;0;0;457.56;328.8;;;;;</p>
  </blockquote>
  
  <p>Sorry I don't know how to structure this nicer, I'll post an image of one of the rows in the excel file before and after I clear formatting as well.</p>
  
  <p>Before:
  <a href="http://imgur.com/f6jRBZR" rel="nofollow">http://imgur.com/f6jRBZR</a> </p>
  
  <p>After:
  <a href="http://imgur.com/M1mQb8V" rel="nofollow">http://imgur.com/M1mQb8V</a></p>
  
  <p>Is there a more efficient way to do this ?</p>