title: Blank spaces in CSV file
body: <p>I am using php to export data from Database.My problem is.Data export successfully but it create two blank rows at beginning.I want to remove them.Here is my code</p>
  
  <pre><code>if($_POST){
  $output = "";
  $table = "schedule"; // Enter Your Table Name 
  $sql = mysql_query("select * from $table WHERE post_id='".$_POST['schedule_id']."'");
  $columns_total = mysql_num_fields($sql);
  for ($i = 0; $i &lt; $columns_total; $i++) {
  $heading = mysql_field_name($sql, $i);
  $output .= '"'.$heading.'",';
  }
  $output .="\n";
  while ($row = mysql_fetch_array($sql)) {
  for ($i = 0; $i &lt; $columns_total; $i++) {
  $output .='"'.trim($row["$i"]).'",';
  }
  $output .="\n";
  }
  $filename = "schedule.csv";
  header('Content-type: application/csv');
  header('Content-Disposition: attachment; filename='.$filename);
  echo $output;
  exit;
  }
  </code></pre>