[thelist] special characters in PHP/MySQL

sasha spam at bittersweet2.com
Wed Oct 23 17:17:01 CDT 2002


You could select everything from the database and do a
str_replace for the 1/2 to replace it with the html
entity and put it back in the database.

PHP/MySQL is ok with html entities, I use them
regularly and haven't had any trouble.  But, you'll
have a problem when you view the output in a form (a
limitation of forms/HTML), and all you'll have to do
is another str_replace on the data being displayed in
the form that changes '&' to '&' (the source will
read >, but the form will display >).

sasha

10/23/2002 11:54:24 AM, "Tony Crockford"
<tonyc at boldfish.co.uk> wrote:

>Hi
>
>anyone got any good resources I can refer to for the
following
>conundrum:
>
>I've got a MySQL database that was created by
importing from MS Access.
>
>I'm reading it out with PHP to xhtml pages.
>
>The problem is that someone has typed 1/2 into
Access, which obligingly
>replaced it with the fraction 1/2 symbol, but this
has not survived the
>transition through PHP to the page.
>
>Help and pointers much appreciated.
>
>Googling for "1/2 in PHP" not giving me much success
atm!
>
>TIA
>
>Tony
>
>
>
>--
>http://www.maccaws.org/
>[Making A Commercial Case for Adopting Web Standards]
>
>--
>For unsubscribe and other options, including
>the Tip Harvester and archive of thelist go to:
>http://lists.evolt.org Workers of the Web, evolt !
>






More information about the thelist mailing list