开发者

Android real escape string in sqlite

How can i use php real_escape_string i开发者_如何转开发n android sqlite?

when i add the following to my table row's value "asd'" then i getting a crash because of "'" char. How can I escape illegal characters in android sqlite?

Thanks

edit: in android, not php


I think an equivalent function is DatabaseUtils.sqlEscapeString(stringToEscape). (Javadoc: SQL_escape a string).

If you are using the SQLiteDatabase insert method taking a ContentValues as a parameter, these may be automatically escaped for you, but I'm not 100% (and I haven't been able to check).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜