skip to Main Content

I’m trying to do the following query in phpMyAdmin and errors occur.I have looked at similar problems, but I still can’t figure out why it doesn’t work.

INSERT INTO discussion_forum (event_type, title) VALUES ('edx.forum.thread.viewed', 'Which of the stories you've seen or read can you relate to? Why?')

The static analysis is

3 errors were found during analysis.

Unexpected character. (near "?" at position 143)
Unexpected character. (near "?" at position 148)
Ending quote ' was expected. (near "" at position 151)

Thank you for your time.

3

Answers


  1. Escape ' by doubling them,

    'Which of the stories you''ve seen or read can you relate to? Why?'
    
    Login or Signup to reply.
  2. You have a quote (‘) in your string, you should escape it with backslash ()

    INSERT INTO discussion_forum (event_type, title) VALUES 
    ('edx.forum.thread.viewed', 'Which of the stories you've seen or read can you relate to? Why?')
    
    Login or Signup to reply.
  3. Your problem is ‘ this quot so you need to change this like below

    INSERT INTO discussion_forum (event_type, title) VALUES ('edx.forum.thread.viewed', 'Which of the stories you've seen or read can you relate to? Why?')
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search