| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Database |
JDatabase |
getQuery |
getQuery() |
Never | Work in Progress |
Returns the current value of the internal SQL query string (as set-up by JDatabase->setQuery.The string has HTML special characters escaped and will be surrounded by HTML <pre> tags so that it is suitable for output to web browsers in an error message, for example.
string getQuery ()
Example
$database =& JFactory::getDBO(); $database->setQuery( $sql ); echo 'The query is: ' . $database->getQuery();
would produce:
Result
The query is: <pre>SELECT * FROM jos_users</pre>