JTableUpdate/find: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 1: | Line 1: | ||
===Syntax=== | ===Syntax=== | ||
<source lang="php">find($options=Array())</source> | <source lang="php">find($options=Array())</source> | ||
| Line 35: | Line 33: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=find | category=find | ||
category=JTableUpdate | category=JTableUpdate | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 02:12, 25 March 2017
Syntax
find($options=Array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $options | Array() |
Defined in
libraries/joomla/database/table/update.php
Importing
jimport( 'joomla.database.table.update' );
Source Body
function find($options=Array()) {
$dbo =& JFactory::getDBO();
$where = Array();
foreach($options as $col=>$val) {
$where[] = $col .' = '. $dbo->Quote($val);
}
$query = 'SELECT update_id FROM #__updates WHERE '. implode(' AND ', $where);
$dbo->setQuery($query);
return $dbo->loadResult();
}
Examples
Code Examples