469,645 Members | 1,656 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

& not retrieve from Mysql Database

Hello friends,

I have face a problem, the problem is that when i fetch data from mysql database i get '&' in the place of '&'. I am using php 5.1.2 and mysql version 5.0.11-beta.

What is the problem? any body solve my problem?

Please answer me.

Thanks in advance!
Aug 5 '09 #1
3 3289
code green
1,726 Expert 1GB
Are you sure?
If viewing results in a browser you won't see the 'amp;'
Aug 5 '09 #2
Thanks for your reply.

Yes i can't see the 'amp;'.

I entered a text like 'testing articles & others' in a text box. This text saved in a mysql database like 'testing articles & others'. But when i fetch this text through mysql_fetch_assoc the text display in the browser like 'testing articles & others' and if i submit this text again in the database i find only 'testing articles & others' . So each time when i edit this i have to put '&' in the place of '&'.

Thanks in advance!
Aug 6 '09 #3
code green
1,726 Expert 1GB
If you view the browser source code you will see '&' It is still there just not visible in the browser as should be.
But if I understand your problem, you wish to reinsert the edited data back into the DB with 'amp;' still intact.

First just double check what I have said above is correct.
Then are you using PHP by any chance?
If so try calling function htmlspecialchars() just before inserting the text back into the DB.

Failing that, the only thing I can think of is runnng the text through your own function using string functions to add the additional 'amp;' before re-insertion
Aug 6 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by James | last post: by
1 post views Thread by Ken | last post: by
3 posts views Thread by Steven Sinfield | last post: by
2 posts views Thread by pmz | last post: by
ronverdonk
4 posts views Thread by ronverdonk | last post: by
reply views Thread by AndrewJ | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.