A
A
Andrey Terentiev2015-12-10 20:44:27
PHP
Andrey Terentiev, 2015-12-10 20:44:27

Filling excel file from php, what's wrong?

Good time of the day. To fill the excel template from php I use the PhpExcel component. Either I don’t understand anything, or some kind of nonsense is really going on ... I ask for help.

$sql1 = mysql_query("SELECT * FROM `price` WHERE id IN (".$r.")", $dblink);

while ($result1 = mysql_fetch_array($sql1)) {
    $repair[] = $result1[1];
}
$repair_count = count($repair);

for($i=0, $s=16; $i <= $repair_count; $i++, $s++){
    $objPHPExcel->getActiveSheet()->SetCellValue('B'.$s, $repair[$i]);
    $objPHPExcel->getActiveSheet()->SetCellValue('I'.$s, $worker);
}

bVL3s.jpg
Those. It turns out that php thinks that I am outputting something to the browser on line 45, but this is not so ... Moreover, if you write a static variable there (and not loop through the array), there is no problem.
Please help, what could be the problem? Please help me, I really need it ... The second day I'm already suffering ... Thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2015-12-10
@prototype_denis

I noticed you have an extension from lingualeo.com
Let it help you translate messages about accessing a non-existent index on the 45th line, about already sent headers on 65 and about the same headers, but on the 66th.
Add words to study, you can do it at lingualeo.com . And don't translate error messages like that anymore.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question