JDatabase/setQuery: Difference between revisions
From Joomla! Documentation
m removing red link to edit, no existant pages |
m preparing for archive only |
||
| Line 55: | Line 55: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=setQuery | category=setQuery | ||
category=JDatabase | category=JDatabase | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 00:27, 25 March 2017
Description
Sets the SQL query string for later execution.
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
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;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples