I suggest this to resolve quoting problems, if losing the quotes is acceptable. If not, it's a little more complicated:
Code:
[FONT="Courier New"] if ($_POST['order_comments'] == 1) {
if ($_POST['filelayout2'] == 1) { // 1 Product per row
$orders_comments_query="SELECT * FROM " . TABLE_ORDERS_STATUS_HISTORY . " WHERE orders_id = " . $order_details->fields['orders_id'] . " GROUP BY orders_id ORDER BY orders_status_history_id ASC";
$orders_comments = $db->Execute($orders_comments_query);
$note = $orders_comments->fields['comments'];
} else {
$note = $order_details->fields['comments'];
}
$cnote = str_replace(array("\"","\'"), "", $note); // Remove any double or single quotes
$str_export = $str_export . ",\"". str_replace(array("\r\n","\r","\n"), " ", $cnote) . "\""; // Remove any line breaks in first comment and print to export string
}[/FONT]
Bookmarks