Forum Moderators: coopster
but it only outputs in a browser and all in a block without col, rows and col names.
<<<
<?
@ob_start();
include "../root_db_conn/db_fns.php";
// error_reporting (E_ALL);
$conn=db_connect();
$result = mysql_query($sql);
$content_file = "";
$content_file .= "id,username,url,url_title,url_intro,published\r\n";
$sql = "SELECT * FROM suggest_url";
$statement = mysql_query($sql);
while($row = mysql_fetch_array($statement)) {
$content_file .= $row['id'] . ',' . $row['username'] . ',' . $row['url'] . ',' . $row['url_title'] . ',' . $row['url_intro'] . ',' . $row['published']. "\r\n";
}
$output_file = 'url.csv';
@ob_end_clean();
@ini_set('zlib.output_compression', 'Off');
header('Pragma: public');
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header('Content-Transfer-Encoding: none');
//This should work for IE & Opera
header('Content-Type: application/octetstream; name="' . $output_file . '"');
//This should work for the rest
header('Content-Type: application/octet-stream; name="' . $output_file . '"');
header('Content-Disposition: inline; filename="' . $output_file . '"');
echo $content_file;
exit();
?>
>>>>
The script interprets “, “ as creation of new unwanted col
in one field I have a text excerpt that is anything from 150 to 300 chars long and has here and there some “ , “
Is there a way to address that problem?
Or should I do a preg_replace and insert a double space or another character?