|
|
Home Manual 11. API Reference [REVIEW] database->Quote |
| [REVIEW] database->Quote |
|
|
|
|
Last reviewed: Not reviewed database->QuoteReturns 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 ( string $text )
ExamplesExample: function doQuery( $text ) { global $database; $text = $database->Quote( $text ); $sql = "SELECT * FROM #__content WHERE introtext=$text"; $database->setQuery( $sql ); if (!$database->query()) { echo $database->stderr(); return false; } echo $database->getQuery(); } doQuery( "Joomla 4.5 is 'Power in Simplicity'!" ); might produce: SELECT * FROM mos_content WHERE introtext='Joomla 4.5 is \'Power in Simplicity\'!' Please report any errors on this page to the Developer Documentation Forum. |
|
| Last Updated ( Monday, 25 December 2006 ) |
| < Prev | Next > |
|---|





