How can i use php real_escape_string in 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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With