Fix sql query

This commit is contained in:
alex 2018-03-27 11:32:08 +03:00
parent b8f50b78d8
commit aca26438db

View file

@ -65,8 +65,8 @@ public class WikivoyageDbHelper {
SQLiteConnection conn = openConnection(); SQLiteConnection conn = openConnection();
if (conn != null) { if (conn != null) {
try { try {
String dbQuery = SEARCH_TABLE_SELECT + " WHERE " + SEARCH_COL_SEARCH_TERM + " LIKE " + "'%" + searchQuery + "%'"; String dbQuery = SEARCH_TABLE_SELECT + " WHERE " + SEARCH_COL_SEARCH_TERM + " LIKE ?";
SQLiteCursor cursor = conn.rawQuery(dbQuery, null); SQLiteCursor cursor = conn.rawQuery(dbQuery, new String[]{"%" + searchQuery + "%"});
if (cursor.moveToFirst()) { if (cursor.moveToFirst()) {
do { do {
res.add(readSearchResult(cursor)); res.add(readSearchResult(cursor));