HTML <font style="color:red">

I am inserting the subject value into the database.  I replaced the " with ''' (3 quotes).  It saves it in the database as one '.  How can I save it so it produces double quotes for the webpage?
LVL 2
CipherISAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Juan OcasioApplication DeveloperCommented:
You have to save it with 4 quotes to get double quotes
0
CipherISAuthor Commented:
Thanks

It broke the web page.  Hmm.  Works with the single quotes but it should be double.
0
Juan OcasioApplication DeveloperCommented:
What are you trying to insert into the database?  If you're trying to insert

HTML <font style="color:red">

you just need to surround with single quotes:

'HTML <font style="color:red">'
0
The Five Tenets of the Most Secure Backup

Data loss can hit a business in any number of ways. In reality, companies should expect to lose data at some point. The challenge is having a plan to recover from such an event.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
I am inserting the subject value into the database.  I replaced the " with ''' (3 quotes).  It saves it in the database as one '.  How can I save it so it produces double quotes for the webpage?
Can you provide the codes how you save the value into database?

and how you display it into HTML?

in this case, we may need to do some encoding either at database or HTML (server side scripting) end.
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Show us the code so we can check for any typo or something that might be missing.
0
CipherISAuthor Commented:
Below is the code.  It works as expected on the website when it pulls the data.  
UPDATE PART
SET [description] = '<font style=''color:red''><b>NOTE: This Option is No Longer Available for New Designs</b></font><br/>None',
html_description = '<font style=''color:red''><b>NOTE: This Option is No Longer Available for New Designs</b></font><br/>None'
WHERE id = 1

Open in new window

0
Vitor MontalvãoMSSQL Senior EngineerCommented:
The command seems correct to me. You just need to double the single quote to have it stored as single quote.
0
CipherISAuthor Commented:
It is storing it as a single quote.
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Isn't what you want? If you want double quotes then just use them as below example:
UPDATE PART
SET [description] = '<font style="color:red"><b>NOTE: This Option is No Longer Available for New Designs</b></font><br/>None',
	html_description = '<font style="color:red"><b>NOTE: This Option is No Longer Available for New Designs</b></font><br/>None'
WHERE id = 1

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.