Uso questo file
il problema è che il file che mi esce fuori ha le virgolette per ogni riga che produce:Codice PHP:<?php // connect to the database include 'header.php'; include 'funzioni.php'; include('connect-db.php'); $fp = fopen ('appuntamenti.csv','w'); fputcsv($fp,array("Subject,Start Date,Start Time,End Date,End time,All Day Event,Description,Location,Private")); fputcsv($fp,array("")); $query1 = mysql_query ("SELECT * FROM appuntamenti") or die (mysql_error()); while($row = mysql_fetch_array( $query1 )){ $id = $row['id_cliente']; $orario = $row['orario']; $testo = $row['testo']; $str_data = $row['str_data']; $str_data = date ('d/m/Y', $str_data); $inizio = date('H:i',$orario); $tempo = $row['tempo']; $fine = date("H:i",strtotime($tempo,$orario)); $query2 = mysql_query ("SELECT * FROM clienti WHERE id=$id") or die (mysql_error()); $row2 = mysql_fetch_array( $query2 ); $cognome = $row2['cognome']; $nome = $row2['nome']; fputcsv($fp,array("$nome $cognome,$str_data,$inizio,$str_data,$fine,,$testo,,,")); } fclose($fp); rename('appuntamenti.csv', 'C:\Users\Podoros\Desktop\appuntamenti.csv');echo 'Esportazione eseguita: appuntamenti.csv'; ?>
"Subject,Start Date,Start Time,End Date,End time,All Day Event,Description,Location,Private"
"PINCO PALLINO,22/01/2019,17:10,22/01/2019,17:55,,,,,"
Come posso averele righe senza le " iniziali e finali?

Rispondi quotando
