# Displaying text from database

**URL:** <https://forum.kirupa.com/t/displaying-text-from-database/57425>\
**Category:** programming\
**Created:** [July 13, 2004, 3:39am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425 "2004-07-13T03:39:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rflorico](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rflorico](https://forum.kirupa.com/u/rflorico)\
**Post date:** [July 13, 2004, 3:39am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/1 "2004-07-13T03:39:48Z")

</div>

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. 🅱

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 3:52am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/2 "2004-07-13T03:52:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 3:54am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/3 "2004-07-13T03:54:18Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 3:55am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/4 "2004-07-13T03:55:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 4:32am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/5 "2004-07-13T04:32:50Z")

</div>

I know in some text editors, there is a find and replace function, so you could find all  
" ’ "s and replace them with " /’ "s

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 4:35am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/6 "2004-07-13T04:35:29Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 4:36am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/7 "2004-07-13T04:36:30Z")

</div>

the problem is flash don’t display double quote (I wonder why?) it display a square character rather than a double quote.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2004, 3:21am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/8 "2004-07-14T03:21:10Z")

</div>

To see what I’m trying to say, look at this URL:  
[http://angdatingdaan.org/flashsite/combo.swf](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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2004, 4:36am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/9 "2004-07-14T04:36:18Z")

</div>

You could put in two single quotes.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2004, 7:20am UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/10 "2004-07-14T07:20:04Z")

</div>

> [@Krilnon](#):
>
> 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 (/)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2004, 10:42pm UTC](https://forum.kirupa.com/t/displaying-text-from-database/57425/11 "2004-07-14T22:42:35Z")

</div>

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.
