PDA

View Full Version : Displaying text from database



rflorico
July 13th, 2004, 12:39 AM
Good Day!

Just want to ask how to display text in a textbox if the string from my database (php-mysql-flash) have double quotes/single quotes. Somethings goes wrong.

The scenario is this: I have a dropdown menu in flash, when i select a title, the content will be displayed in the textbox, but the content sometimes have different characters and sometimes when a the the first occurence of the double quote reaches, the string to be displayed stops there.

my content is this: THe quick brown fox jumps 'over' the lazy dog.

the textbox (in flash) only displays : THe quick brown fox jumps

And when I look at the database, the content looks like this: THe quick brown fox jumps “over“ the lazy dog.

Can someone help me please.

Thanks in Advance. :b:

Krilnon
July 13th, 2004, 12:52 AM
I think a "/" before each quote might help. I know in php that a "/" makes it treat it as a character, not a command of any sort.

THe quick brown fox jumps /'over/' the lazy dog.

rflorico
July 13th, 2004, 12:54 AM

rflorico
July 13th, 2004, 12:55 AM
Do I have to put the backslashes manually in my content? Is there any function in php to put that slashes automatically because the quotes are so many?

Anyways, thanks a lot.

Krilnon
July 13th, 2004, 01:32 AM
I know in some text editors, there is a find and replace function, so you could find all
" ' "s and replace them with " /' "s

rflorico
July 13th, 2004, 01:35 AM

rflorico
July 13th, 2004, 01:36 AM
the problem is flash don't display double quote (I wonder why?) it display a square character rather than a double quote.

rflorico
July 14th, 2004, 12:21 AM
To see what I'm trying to say, look at this URL:
http://angdatingdaan.org/flashsite/combo.swf
and try to select from the dropdown menu and listbox, Select Biblically Speaking from the dropdown menu and number 3 from the listbox and look see how its error. Please help.

Krilnon
July 14th, 2004, 01:36 AM
You could put in two single quotes.

andr.in
July 14th, 2004, 04:20 AM
I think a "/" before each quote might help. I know in php that a "/" makes it treat it as a character, not a command of any sort.

THe quick brown fox jumps /'over/' the lazy dog. dood backslashes do that (\) not regular slashes (/)

Hans Kilian
July 14th, 2004, 07:42 PM
Run your text through addslashes before you insert it into the table: $text = addslashes($text).

And the remove them again when you retrieve the data with stripslashes.