Skip to content Skip to sidebar Skip to footer

Android.database.sqlite.sqliteexception: Near "s": Syntax Error (code 1): ,

android.database.sqlite.SQLiteException: near 's': syntax error (code 1): , while compiling: INSERT OR REPLACE INTO movies(backdrop_path,id,original_language,orginal_title,overview

Solution 1:

You have an 's in a string and didn't escape it. To avoid this, never do a direct insert like this- always use bind variables. That will also avoid SQL injection bugs that I'm sure your code is riddled with based on this.

Solution 2:

you are trying to insert There's Max where (') should be escaped like There\'s Max

Solution 3:

Your error is most probably in this input:

An apocalyptic story set in the furthest reaches of our planet, in a stark desert landscape where humanity is broken, and most everyone is crazed fighting for the necessities of life. Within this world exist two rebels on the run who just might be able to restore order. There's Max, a man of action and a man of few words, who seeks peace of mind following the loss of his wife and child in the aftermath of the chaos. And Furiosa, a woman of action and a woman who believes her path to survival may be achieved if she can make it across the desert back to her childhood homeland.

You have an unescaped single quote at the part of ... There's Max

When SQLite tries to execute the insertion of this record, it ends at that single quote, after that, it tries to process the s Max, a man of action ....

To solve this, escape the ' as such: \'

You have to escape your characters in SQLite to avoid errors like these and SQL Injections.

Post a Comment for "Android.database.sqlite.sqliteexception: Near "s": Syntax Error (code 1): ,"