Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
384 views
in Technique[技术] by (71.8m points)

html - phpspreadsheet read-load not reading php/mysql rows

I'm using phpspreadsheet to export xlsx from a html file using the below code.

require_once __DIR__.'/vendor/autoload.php';

$reader = new PhpOfficePhpSpreadsheetReaderHtml();

$spreadsheet = $reader->load("../appln_enterprise/bl/hello.php");

$writer = PhpOfficePhpSpreadsheetIOFactory::createWriter($spreadsheet, 'Xls');
$writer->save('write1.xls'); 

Though it is capturing the html contents, but it is unable to read the mysql_fetch_array/php part of the code which is as given below:

<? 
$quer39=mysqli_query($con1,"select * from ..");
while($resul39=mysqli_fetch_array($quer39))
{    
?>
<tr>
<td>Column - 1</td>
<td>Column - 2</td>
<td>Column - 3</td>
<td>Column - 4</td>
<td>Column - 5</td>
<td>Column - 6 <?=$_GET ['do'] ?></td>
</tr>
<? } ?>

Though samples, and documentations reveals that all html involving sql and php queries can be read and exported to xlsx, but is not working right now. What shall we do

question from:https://stackoverflow.com/questions/65888499/phpspreadsheet-read-load-not-reading-php-mysql-rows

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...