8
I was able to create a perfect . xls file, but . csv can’t follow the code I used to create . xls
$dadosXls = "";
$dadosXls .= " <table border='1' >";
$dadosXls .= " <tr>";
$dadosXls .= " <th>Nr-Série</th>";
$dadosXls .= " <th>Cód-Secret</th>";
$dadosXls .= " <th>QtdPontos</th>";
$dadosXls .= " <th>DataImpres</th>";
$dadosXls .= " <th>Id-Estab</th>";
$dadosXls .= " <th>Status</th>";
$dadosXls .= " <th>DtaValidadeReg</th>";
$dadosXls .= " <th>DataImportacao</th>";
$dadosXls .= " <th>IdRegra</th>";
$dadosXls .= " </tr>";
while ($escrever=mysqli_fetch_array($select)){
$dadosXls .= " <tr>";
$dadosXls .= " <td>".$escrever['nrSerie']."</td>";
$dadosXls .= " <td>".$escrever['codSecreto']."</td>";
$dadosXls .= " <td>".$escrever['QtdPontos']."</td>";
$dadosXls .= " <td>".$escrever['DataImpres']."</td>";
$dadosXls .= " <td></td>";
$dadosXls .= " <td>".$escrever['Status']."</td>";
$dadosXls .= " <td>".$escrever['DtaValidadeReg']."</td>";
$dadosXls .= " <td>".$escrever['DataImportacao']."</td>";
$dadosXls .= " <td>680</td>";
$dadosXls .= " </tr>";
}
$dadosXls .= " </table>";
thanks for the help.
Welcome to Sopt. I suggest you read [Ask] and mcve to know how to ask a good question. And honestly did not understand what you want, export csv from the database or php?
– user28595
a glance at http://phpexcel.codeplex.com/, a very good lib for importing and exporting data, I used to do the same way you did, after I met this lib my life changed for the better... ;)
– Marcelo Diniz
Diego, I do a query with php and with the result of this querie I want to make a file . csv
– Murilo Souza
Marcelo, thanks for the suggestion, but I didn’t understand very well how this framework works.
– Murilo Souza