Actions

API15

JDatabase/setQuery

From Joomla! Documentation

< API15:JDatabase
Revision as of 17:14, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Sets the SQL query string for later execution.

[Edit Descripton]

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] SeeAlso:JDatabase/setQuery

Examples

<CodeExamplesForm />