API15:JDatabase/setQuery
From Joomla! Documentation
Description
Sets the SQL query string for later execution.
Template:Description:JDatabase/setQuery
Syntax
setQuery($sql, $offset=0, $limit=0, $prefix='#__')
| Parameter Name | Default Value | Description |
|---|---|---|
| $sql | The SQL query | |
| $offset | 0 | The offset to start selection |
| $limit | 0 | The number of results to return |
| $prefix | '#__' | The common table prefix |
Defined in
libraries/joomla/database/database.php
Importing
jimport( 'joomla.database.database' );
Source Body
function setQuery( $sql, $offset = 0, $limit = 0, $prefix='#__' )
{
$this->_sql = $this->replacePrefix( $sql, $prefix );
$this->_limit = (int) $limit;
$this->_offset = (int) $offset;
}
[Edit See Also] Template:SeeAlso:JDatabase/setQuery
Examples
<CodeExamplesForm />