What are database escape() and quote() used for?

joomla

Solution

Thes escape function is used to escape bad characters in order to protect against SQL injection.

The quote* functions are used to quote strings, because different database dialects have different quoting characters.

So depending on the database system you use, Joomla will choose the appropriate quoting characters.

Problem

I looked at some joomla components and there are functions like ``` $db->escape() $db->quote() ``` What are they used for ? Thanks

Original source