# How do I put a percentage sign in a text string loading from database?

**URL:** <https://forum.kirupa.com/t/how-do-i-put-a-percentage-sign-in-a-text-string-loading-from-database/12977>\
**Category:** flash\
**Created:** [February 6, 2003, 10:55pm UTC](https://forum.kirupa.com/t/how-do-i-put-a-percentage-sign-in-a-text-string-loading-from-database/12977 "2003-02-06T22:55:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![3dron](https://avatars.discourse-cdn.com/v4/letter/3/2acd7d/32.png) [@3dron](https://forum.kirupa.com/u/3dron)\
**Post date:** [February 6, 2003, 10:55pm UTC](https://forum.kirupa.com/t/how-do-i-put-a-percentage-sign-in-a-text-string-loading-from-database/12977/1 "2003-02-06T22:55:46Z")

</div>

I have everything working! I can change my database text, and call it from my flash through php. But it doesn’t seem to translate over the ‘%’ sign.

I know this is probably not database specfic.

“Text=Test text&Comment=Take 10% off all products”

The variable Comment only comes out as:

Take 10 of all products.

Do I use an escape character?

Thanks for any help

Ron

---

<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:** [February 7, 2003, 3:59am UTC](https://forum.kirupa.com/t/how-do-i-put-a-percentage-sign-in-a-text-string-loading-from-database/12977/2 "2003-02-07T03:59:33Z")

</div>

try %… not sure if it’ll work though…

---

<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:** [February 7, 2003, 4:04am UTC](https://forum.kirupa.com/t/how-do-i-put-a-percentage-sign-in-a-text-string-loading-from-database/12977/3 "2003-02-07T04:04:36Z")

</div>

&Comment=Take 10%25 off all products

---

<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:** [February 7, 2003, 7:35am UTC](https://forum.kirupa.com/t/how-do-i-put-a-percentage-sign-in-a-text-string-loading-from-database/12977/4 "2003-02-07T07:35:17Z")

</div>

Thanks, worked perfectly. Where is the documentation for this?

What part is making it work the ‘25’, or is ‘%25’ an escape character for ‘%’?

Thanks

---

<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:** [February 7, 2003, 10:43am UTC](https://forum.kirupa.com/t/how-do-i-put-a-percentage-sign-in-a-text-string-loading-from-database/12977/5 "2003-02-07T10:43:54Z")

</div>

Just a guess here, I see no “” anywhere, so Im guessing it only uses key characters when parsing strings within a “”

again, just an assumption from other programming languages.

---

<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:** [February 7, 2003, 2:03pm UTC](https://forum.kirupa.com/t/how-do-i-put-a-percentage-sign-in-a-text-string-loading-from-database/12977/6 "2003-02-07T14:03:40Z")

</div>

Everything should be in the AS Dictionary 🙂

And the whole thing makes it work. I believe it’s % and then the ASCII code.

---

<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:** [February 7, 2003, 6:35pm UTC](https://forum.kirupa.com/t/how-do-i-put-a-percentage-sign-in-a-text-string-loading-from-database/12977/7 "2003-02-07T18:35:41Z")

</div>

> \*Originally posted by 3dron \*  
> **What part is making it work the ‘25’, or is ‘%25’ an escape character for ‘%’?**

‘%25’ = %

> \*Originally posted by 3dron \*  
> **Where is the documentation for this?**

Simply, do the following:

string = “%”  
trace(escape(string));

---

<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:** [February 8, 2003, 3:48pm UTC](https://forum.kirupa.com/t/how-do-i-put-a-percentage-sign-in-a-text-string-loading-from-database/12977/8 "2003-02-08T15:48:34Z")

</div>

Just to split hair a bit more, don’t call your variable string, it’s confusing, and it might be a reserved word 🙂
