0

this is my quary.i want to add html text to my data base

INSERT INTO minute_item ( meeting_minute_id , type , text , date , responsible , status , finished_date,seq_id, cellHeight) VALUES ("5","Info", "<font face="Arial" size="3"><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">sdfsdfsdfsdfd</span></font>", "(null)","","open","(null)","3","79.000000") 

it gives this error message.can you please how to solve this error enter image description here

2
  • 1
    You need to escape your input before inserting Commented Nov 23, 2013 at 15:15
  • 1
    A string literal is quoted using single quotes ', not double, ". Commented Nov 23, 2013 at 15:15

1 Answer 1

1

In SQL, strings use single quotes. (Double quotes are supported in SQLite only for compatibility with MySQL.) The correct syntax looks like this:

INSERT INTO minute_item (
    meeting_minute_id, type, text, date, responsible,
    status, finished_date, seq_id, cellHeight)
VALUES (
    '5', 'Info',
    '<font face="Arial" size="3"><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">sdfsdfsdfsdfd</span></font>',
    '(null)', '', 'open', '(null)', '3', '79.000000')

If you want to use a single quote inside a string, you have to double it: 'it''s like this'. (It would work the same way with double quotes.)

Please note that numbers that you want to store as numbers, not as strings, must not be quoted.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.