I am trying to insert text messages from an inbox to a SQLite Database, but due to some special characters/symbols it doesn't insert properly.
I went through some question in Stackoverflow but nothing seems useful.
I got this code, but it is not working.
data.execSQL("INSERT INTO recor(text) VALUES('"+DatabaseUtils.sqlEscapeString(messag)+"')");
My database has only one field in it and am trying to insert details of messages along with it. I am putting the details (type, time, number, message) to a single string message and recor is my table name.
This is what I get as toast when I use a try catch loop.
Error is near:
"FROM":syntax error:INSERT INTO recor(text) VALUES("FROM 15555215556 Message:-MSG")
recordinstead ofrecor?recor.textinstead ofrecor(text)