My Excel file will not open

Topics: User Forum
Oct 28, 2010 at 1:21 PM

 

When I add this to the file, it will no longer open.
Any help?


$i = 2;
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC)) {
$customernr = $row["customernr"];

$first_name = $row["first_name"];

$last_name = $row["last_name"];


$objPHPExcel->setActiveSheetIndex(0)

 ->setCellValue('A' . $i, "$customernr")

->setCellValue('B' . $i, "$first_name")

->setCellValue('C' . $i, "$last_name")


$i = $i + 1;
}

Oct 28, 2010 at 4:15 PM

If I remove

while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC)) {

it´s works - But i don´t understand why...

Coordinator
Nov 1, 2010 at 11:03 PM
luth wrote:

If I remove

while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC)) {

it´s works - But i don´t understand why...

 Me neither. Is there a problem with your SQL?