Difference between revisions of "JDatabaseMySQL/query"
From Joomla! Documentation
< API15:JDatabaseMySQL
(New page: ===Description===
Execute the query
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>...) |
m (preparing for archive only) |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Syntax=== | ===Syntax=== | ||
Line 56: | Line 56: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Examples=== | ===Examples=== | ||
− | + | === Code Examples === | |
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=query | category=query | ||
category=JDatabaseMySQL | category=JDatabaseMySQL | ||
− | + | namespace=CodeExample | |
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
+ | [[Category:Archived pages API15]] |
Latest revision as of 19:28, 24 March 2017
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Execute the query
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
query()
Returns[edit]
mixed A database resource if successful, FALSE if not.
Defined in[edit]
libraries/joomla/database/database/mysql.php
Importing[edit]
jimport( 'joomla.database.database.mysql' );
Source Body[edit]
function query()
{
if (!is_resource($this->_resource)) {
return false;
}
// Take a local copy so that we don't modify the original query and cause issues later
$sql = $this->_sql;
if ($this->_limit > 0 || $this->_offset > 0) {
$sql .= ' LIMIT '.$this->_offset.', '.$this->_limit;
}
if ($this->_debug) {
$this->_ticker++;
$this->_log[] = $sql;
}
$this->_errorNum = 0;
$this->_errorMsg = '';
$this->_cursor = mysql_query( $sql, $this->_resource );
if (!$this->_cursor)
{
$this->_errorNum = mysql_errno( $this->_resource );
$this->_errorMsg = mysql_error( $this->_resource )." SQL=$sql";
if ($this->_debug) {
JError::raiseError(500, 'JDatabaseMySQL::query: '.$this->_errorNum.' - '.$this->_errorMsg );
}
return false;
}
return $this->_cursor;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
Code Examples[edit]