By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,017 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

& not retrieve from Mysql Database

P: 2
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
Share this Question
Share on Google+
3 Replies


code green
Expert 100+
P: 1,726
Are you sure?
If viewing results in a browser you won't see the 'amp;'
Aug 5 '09 #2

P: 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
Expert 100+
P: 1,726
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.