====== getQuery ====== {#JAPI Joomla.Framework Database JDatabase::getQuery #} Returns the current value of the internal SQL query string (as set-up by [[JDatabase-setQuery|JDatabase->setQuery]].The string has HTML special characters escaped and will be surrounded by HTML
 tags so that it is suitable for output to web browsers in an error message, for example.

===== Syntax =====
string getQuery ()

===== Examples =====

$database =& JFactory::getDBO();
$database->setQuery( $sql );
echo 'The query is: ' . $database->getQuery();

would produce:

The query is: 
SELECT * FROM jos_users
---- ~~DISCUSSION~~