I'm trying to give insert
in a table, however it gives syntax error. I believe it's because of the accent, but even researching can not solve.
Error log:
11-19 00: 34: 52.959: W / AQuery (21157): reporting: android.database.sqlite.SQLiteException: near "water": syntax error (code 1):, while compiling: INSERT OR REPLACE into news (noticia_id, conteudo, title, abstract, image, date) VALUES (10228, 'A Chapada Diamantina reserves true natural monuments to those who venture in their paths: some of the highest and beautiful waterfalls of Brazil are here, as a reward, in the end of the track, by the effort of the travelers. Be dazzled by the grandeur the ten largest waterfalls in the region, in images selected by Guide.
Insert in the code:
String query = "INSERT OR REPLACE into noticia (noticia_id, conteudo, titulo, resumo, imagem, data) VALUES (" + n.getId() + ", '" + n.getPost_content().replaceAll("’", "")
+ "', '" + n.getPost_title() + "', '" + n.getPost_excerpt().replaceAll("’", "") + "', '" + n.getImagem() + "', '" + n.getPost_modified() + "');";
mDb.execSQL(query);