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?
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
CipherISAuthor Commented:
Thanks

It broke the web page.  Hmm.  Works with the single quotes but it should be double.
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">'
CEOs need to know what they should worry about

Nearly every week during the past few years has featured a headline about the latest data breach, malware attack, ransomware demand, or unrecoverable corporate data loss. Those stories are frequently followed by news that the CEOs at those companies were forced to resign.

Ryan ChongSoftware Team LeadCommented:
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.
Vitor MontalvãoMSSQL Senior EngineerCommented:
Show us the code so we can check for any typo or something that might be missing.
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

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.
CipherISAuthor Commented:
It is storing it as a single quote.
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

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.