references:joomla.framework:database:jdatabase-quoteQuote
ADODB Compatibility function. See http://phplens.com/adodb/reference.functions.quote.html for more information. Returns a quoted string with all characters that have special meaning for the database escaped. This function is the same as database→getEscaped except that the string returned is surrounded by single quotes. Syntaxstring Quote ( $text )
ExamplesExample $database =& JFactory::getDBO(); $text = $database->Quote( "Joomla! is 'Power in Simplicity'!" ); $sql = "SELECT * FROM #__content WHERE introtext=$text"; $database->setQuery( $sql ); if (!$database->query()) { echo $database->stderr(); } echo $database->getQuery(); might produce: Result SELECT * FROM jos_content WHERE introtext='Joomla! is \'Power in Simplicity\'!'
Discussion |


