HTML <font style="color:red">

CipherIS
CipherIS used Ask the Experts™
on
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

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Juan OcasioApplication Developer

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 OcasioApplication Developer

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">'
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Ryan ChongSoftware Team Lead

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
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
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
Distinguished Expert 2017
Commented:
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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial