We help IT Professionals succeed at work.

HTML <font style="color:red">

CipherIS
CipherIS asked
on
281 Views
Last Modified: 2017-03-22
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?
Comment
Watch Question

Juan OcasioContinuous Process Improvement Lead
CERTIFIED EXPERT

Commented:
You have to save it with 4 quotes to get double quotes

Author

Commented:
Thanks

It broke the web page.  Hmm.  Works with the single quotes but it should be double.
Juan OcasioContinuous Process Improvement Lead
CERTIFIED EXPERT

Commented:
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">'
CERTIFIED EXPERT

Commented:
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ãoIT Engineer
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
Show us the code so we can check for any typo or something that might be missing.

Author

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ãoIT Engineer
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
The command seems correct to me. You just need to double the single quote to have it stored as single quote.

Author

Commented:
It is storing it as a single quote.
IT Engineer
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions