A
A
Atlant1Q2018-02-21 10:52:29
SQL
Atlant1Q, 2018-02-21 10:52:29

How to add html page code to table?

I'm trying to do this (the html example is random, for example):

insert into MyTable values ('page1', '<div bgcolor='f2f2f2' style='margin: 0;padding: 0;min-width: 100%!important;' yahoo=''>')

But because of the quotes, everything breaks. How can the problem be solved?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2018-02-21
@fox_12

If you do not need a search in the html text - then as an option - encode in base64 when saving to the database.
Then you can store whatever you like - even binary data ...

G
Gleb Starkov, 2018-02-21
@colonel

Use double quotes in html:
Or escape single quotes:
...bgcolor=\'...\'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question