Skip to content

Instantly share code, notes, and snippets.

@SeanJA
Created July 19, 2010 16:23
Show Gist options
  • Select an option

  • Save SeanJA/481627 to your computer and use it in GitHub Desktop.

Select an option

Save SeanJA/481627 to your computer and use it in GitHub Desktop.
class CI_DB_active_record extends CI_DB_driver {
/**
* Select
*
* Generates the SELECT portion of the query
*
* @access public
* @param string
* @return CI_DB_active_record
*/
function select($select = '*', $escape = NULL)
{
// Set the global value if this was sepecified
if (is_bool($escape))
{
$this->_protect_identifiers = $escape;
}
if (is_string($select))
{
$select = explode(',', $select);
}
foreach ($select as $val)
{
$val = trim($val);
if ($val != '')
{
$this->ar_select[] = $val;
if ($this->ar_caching === TRUE)
{
$this->ar_cache_select[] = $val;
$this->ar_cache_exists[] = 'select';
}
}
}
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment