Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Include slashes in sqlite insert statements
- public void insertBluetoothPath(String path, String build) {
- String[] ColumnName = new String[1];
- ColumnName[0] = "path";
- SQLiteDatabase myDB = null;
- myDB = this.openOrCreateDatabase(DB_PATH, MODE_PRIVATE, null);
- myDB.execSQL("INSERT INTO phones VALUES(" + build + ", " + path + ");");
- myDB.close();
- }
- sqlite returned: error code = 1, msg = near "/": syntax error
- Failure 1 (near "/": syntax error) on 0x2b3ca8 when preparing 'INSERT INTO phones VALUES(sdk, /mnt/sdcard);'.
- myDB.execSQL("INSERT INTO phones VALUES('" + build + "', '" + path + "');");
- myDB.execSQL("INSERT INTO phones VALUES(" + build + ", " + "'" + path + "'" + ");");
Add Comment
Please, Sign In to add comment