Hi I am inserting general comments in to my database dynamically. and my query looks like this:
String sql = "insert into table (comment) values('"+ dynamic_comment + "');";
I am getting an error when a use insert something like this:
I'm doing great
becuase at that time my query becomes:
insert into table (comment) values('I'm doing great');
'I'm doing great'
Error: Caused by: android.database.sqlite.SQLiteException: near "t":
syntax error (code 1): , while compiling:
insert into timeline(comment) values('Can't belive it really works');
Can someone tell me how to overcome this problem and how many other problems I can face like this while working with database.
thanks