I have the following code:
$Name = 'NOMINA-'.$mes.'-'.$dia.'-'.$ano.'.csv';
$rpedidos = "SELECT total,
cuenta FROM nomina";
$reg = $conexion->query($rpedidos);
while( $reg_File = $reg->fetch_array() )
{
$ceros="000";
$ttpago=number_format($reg_File["total"],2);
$ctaBco=$reg_File["cuenta"];
$tt="".$ctaBco."".$ceros."".$ttpago."";
$shtml = $tt."\n";
}
//$shtml=$excel;
//$shtml=$shtml."</table>";
header("Content-Description: File Transfer");
header("Content-Type: application/force-download");
header('Content-Disposition: attachment; filename='.$Name.'');
echo $shtml;
It generates me perfectly, CSV but it divides me the totals in two columns and I only need it in one, some guide.
Thank you.