title: phpexcel printing mysql data to excel( printing only 1 row of data on database to excel)
body: <p>I want to use the 10autofilter.php from phpexcel, to our program. </p>
  
  <p>But I want a code that will print on excel the datas on our database since its only prints row 1 and doesnt print all data on our mysql please help me you can see the code it only output 1 row.</p>
  
  <p>I think there's a problem here but this works fine on php displaying on browser but just not in excel the output is 1 row.</p>
  
  <p>I have used <code>$i++</code> on $row as you can see i dont know what to do.</p>
  
  <pre><code>$res = mysql_query("select * from services");
  $row = mysql_num_rows($res);
  
  for($i=0; $i&lt;$row; $i++)
  {
      $serviceid  = mysql_result($res,$i,"serviceid");
      $servicename  = mysql_result($res,$i,"servicename");
      $contactemail  = mysql_result($res,$i,"contactemail");
      $charge  = mysql_result($res,$i,"charge");
      $contactlastname  = mysql_result($res,$i,"contactlastname");
      $contactmiddlename  = mysql_result($res,$i,"contactmiddlename");
      $yearassistancereceived  = mysql_result($res,$i,"yearassistancereceived");
      $yearestablished  = mysql_result($res,$i,"yearestablished");
  
      $dataArray = array(
          array(
              $serviceid,
              $servicename,
              $contactemail,
              $charge."     ".$contactmiddlename." ".$contactlastname, 
              $yearassistancereceived, 
              $yearestablished
          )
      );
  
      $objPHPExcel-&gt;getActiveSheet()-&gt;fromArray($dataArray, NULL, 'A2');
  }
  </code></pre>
  
  <p>I also have the error:</p>
  
  <blockquote>
    <p>Fatal error. Uncaught exception 'PHPExcel_WriterException' with message 'Invalid parameters passed'. why? at the bottom of the error is written C:\xampp\htdocs\DOSTPROJECT\classes\PHPExcel\Writer\Excel2007\ContentTypes.php on line 263.</p>
  </blockquote>
  
  <p>This executes and excel file but I have said only 1 row data, I mean whats wrong?</p>