You may want to check to see if the php function magic_quotes_gpc is on. It is on by default in php. This function escapes all single quotes, double quotes, and backslashes. So, the values you enter into the database with quotes will be escaped Then, if it's on you can use the function stripslashes to return the values from the database with the backslashes stripped off the string. Tony --- On Sat, 8/21/10, Roger Head <headrog@xxxxxxxxx> wrote: From: Roger Head <headrog@xxxxxxxxx> Subject: quotes and returns To: php-objects@xxxxxxxxxxxxxxx Date: Saturday, August 21, 2010, 4:03 PM Guys, When I select from a table I can't get the quotes and returns to desplay on the web page, I get; St. John�s Cap�s winning triple overtime and it should be St. John's Cap's winning triple overtime I think I should use the str_replace function. Roger Head (709)726-4323(home) (709)690-9006(cell), (709)729-0481(work) www.nlscoreboard.com ________________________________ From: Tony Jones <tjones10707@xxxxxxxxx> To: php-objects@xxxxxxxxxxxxxxx Sent: Tue, August 17, 2010 6:00:21 PM Subject: Re: Export to CSV If you want to export the results of the query you may do something like the following from the mysql> prompt select field1, field2, field3, field4 into outfile '/home/rhead/result.txt' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from your_table; This will produce a file in csv format, see website - http://dev.mysql.com/doc/refman/5.1/en/select.html for details. --- On Tue, 8/17/10, Roger Head <headrog@xxxxxxxxx> wrote: From: Roger Head <headrog@xxxxxxxxx> Subject: Export to CSV To: php-objects@xxxxxxxxxxxxxxx Date: Tuesday, August 17, 2010, 10:25 AM What is the best way to Export a Sql statment to a CSV or Excel file? Roger Head (709)726-4323(home) (709)690-9006(cell), (709)729-0481(work) [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]