Back to Update class

Method find

public string
find
(mixed $options = array())
Method to create and execute a SELECT WHERE query.
Parameters
  • array $options Array of options
Returns
  • string Results of query
Since
  • 1.7.0
Class: Update
Project: Joomla

Method find - Source code

/**
 * Method to create and execute a SELECT WHERE query.
 *
 * @param   array  $options  Array of options
 *
 * @return  string  Results of query
 *
 * @since   1.7.0
 */
public function find($options = array())
{
    $where = array();
    foreach ($options as $col => $val) {
        $where[] = $col . ' = ' . $this->_db->quote($val);
    }
    $query = $this->_db->getQuery(true)->select($this->_db->quoteName($this->_tbl_key))->from($this->_db->quoteName($this->_tbl))->where(implode(' AND ', $where));
    $this->_db->setQuery($query);
    return $this->_db->loadResult();
}