

Public Member Functions | |
| select ($select= '*', $escape=NULL) | |
| Select. | |
| select_max ($select= '', $alias= '') | |
| Select Max. | |
| select_min ($select= '', $alias= '') | |
| Select Min. | |
| select_avg ($select= '', $alias= '') | |
| Select Average. | |
| select_sum ($select= '', $alias= '') | |
| Select Sum. | |
| _max_min_avg_sum ($select= '', $alias= '', $type= 'MAX') | |
| Processing Function for the four functions above:. | |
| _create_alias_from_table ($item) | |
| Determines the alias name based on the table. | |
| distinct ($val=TRUE) | |
| DISTINCT. | |
| from ($from) | |
| From. | |
| join ($table, $cond, $type= '') | |
| Join. | |
| where ($key, $value=NULL, $escape=TRUE) | |
| Where. | |
| or_where ($key, $value=NULL, $escape=TRUE) | |
| OR Where. | |
| orwhere ($key, $value=NULL, $escape=TRUE) | |
| orwhere() is an alias of or_where() this function is here for backwards compatibility, as orwhere() has been deprecated | |
| _where ($key, $value=NULL, $type= 'AND ', $escape=NULL) | |
| Where. | |
| where_in ($key=NULL, $values=NULL) | |
| Where_in. | |
| or_where_in ($key=NULL, $values=NULL) | |
| Where_in_or. | |
| where_not_in ($key=NULL, $values=NULL) | |
| Where_not_in. | |
| or_where_not_in ($key=NULL, $values=NULL) | |
| Where_not_in_or. | |
| _where_in ($key=NULL, $values=NULL, $not=FALSE, $type= 'AND ') | |
| Where_in. | |
| like ($field, $match= '', $side= 'both') | |
| Like. | |
| not_like ($field, $match= '', $side= 'both') | |
| Not Like. | |
| or_like ($field, $match= '', $side= 'both') | |
| OR Like. | |
| or_not_like ($field, $match= '', $side= 'both') | |
| OR Not Like. | |
| orlike ($field, $match= '', $side= 'both') | |
| orlike() is an alias of or_like() this function is here for backwards compatibility, as orlike() has been deprecated | |
| _like ($field, $match= '', $type= 'AND ', $side= 'both', $not= '') | |
| Like. | |
| group_by ($by) | |
| GROUP BY. | |
| groupby ($by) | |
| groupby() is an alias of group_by() this function is here for backwards compatibility, as groupby() has been deprecated | |
| having ($key, $value= '', $escape=TRUE) | |
| Sets the HAVING value. | |
| orhaving ($key, $value= '', $escape=TRUE) | |
| orhaving() is an alias of or_having() this function is here for backwards compatibility, as orhaving() has been deprecated | |
| or_having ($key, $value= '', $escape=TRUE) | |
| Sets the OR HAVING value. | |
| _having ($key, $value= '', $type= 'AND ', $escape=TRUE) | |
| Sets the HAVING values. | |
| order_by ($orderby, $direction= '') | |
| Sets the ORDER BY value. | |
| orderby ($orderby, $direction= '') | |
| orderby() is an alias of order_by() this function is here for backwards compatibility, as orderby() has been deprecated | |
| limit ($value, $offset= '') | |
| Sets the LIMIT value. | |
| offset ($offset) | |
| Sets the OFFSET value. | |
| set ($key, $value= '', $escape=TRUE) | |
| The "set" function. | |
| get ($table= '', $limit=null, $offset=null) | |
| Get. | |
| count_all_results ($table= '') | |
| "Count All Results" query | |
| get_where ($table= '', $where=null, $limit=null, $offset=null) | |
| Get_Where. | |
| getwhere ($table= '', $where=null, $limit=null, $offset=null) | |
| getwhere() is an alias of get_where() this function is here for backwards compatibility, as getwhere() has been deprecated | |
| insert ($table= '', $set=NULL) | |
| Insert. | |
| update ($table= '', $set=NULL, $where=NULL, $limit=NULL) | |
| Update. | |
| empty_table ($table= '') | |
| Empty Table. | |
| truncate ($table= '') | |
| Truncate. | |
| delete ($table= '', $where= '', $limit=NULL, $reset_data=TRUE) | |
| Delete. | |
| dbprefix ($table= '') | |
| DB Prefix. | |
| _track_aliases ($table) | |
| Track Aliases. | |
| _compile_select ($select_override=FALSE) | |
| Compile the SELECT statement. | |
| _object_to_array ($object) | |
| Object to Array. | |
| start_cache () | |
| Start Cache. | |
| stop_cache () | |
| Stop Cache. | |
| flush_cache () | |
| Flush Cache. | |
| _merge_cache () | |
| Merge Cache. | |
| _reset_run ($ar_reset_items) | |
| Resets the active record values. | |
| _reset_select () | |
| Resets the active record values. | |
| _reset_write () | |
| Resets the active record "write" values. | |
Public Attributes | |
| $ar_select = array() | |
| $ar_distinct = FALSE | |
| $ar_from = array() | |
| $ar_join = array() | |
| $ar_where = array() | |
| $ar_like = array() | |
| $ar_groupby = array() | |
| $ar_having = array() | |
| $ar_limit = FALSE | |
| $ar_offset = FALSE | |
| $ar_order = FALSE | |
| $ar_orderby = array() | |
| $ar_set = array() | |
| $ar_wherein = array() | |
| $ar_aliased_tables = array() | |
| $ar_store_array = array() | |
| $ar_caching = FALSE | |
| $ar_cache_exists = array() | |
| $ar_cache_select = array() | |
| $ar_cache_from = array() | |
| $ar_cache_join = array() | |
| $ar_cache_where = array() | |
| $ar_cache_like = array() | |
| $ar_cache_groupby = array() | |
| $ar_cache_having = array() | |
| $ar_cache_orderby = array() | |
| $ar_cache_set = array() | |
Definition at line 29 of file DB_active_rec.php.
| CI_DB_active_record::_compile_select | ( | $ | select_override = FALSE |
) |
Compile the SELECT statement.
Generates a query string based on which functions were used. Should not be called directly. The get() function calls it.
private
Definition at line 1431 of file DB_active_rec.php.
References _merge_cache(), and CI_DB_driver::_protect_identifiers().
Referenced by count_all_results(), get(), and get_where().
01432 { 01433 // Combine any cached components with the current statements 01434 $this->_merge_cache(); 01435 01436 // ---------------------------------------------------------------- 01437 01438 // Write the "select" portion of the query 01439 01440 if ($select_override !== FALSE) 01441 { 01442 $sql = $select_override; 01443 } 01444 else 01445 { 01446 $sql = ( ! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT '; 01447 01448 if (count($this->ar_select) == 0) 01449 { 01450 $sql .= '*'; 01451 } 01452 else 01453 { 01454 // Cycle through the "select" portion of the query and prep each column name. 01455 // The reason we protect identifiers here rather then in the select() function 01456 // is because until the user calls the from() function we don't know if there are aliases 01457 foreach ($this->ar_select as $key => $val) 01458 { 01459 $this->ar_select[$key] = $this->_protect_identifiers($val); 01460 } 01461 01462 $sql .= implode(', ', $this->ar_select); 01463 } 01464 } 01465 01466 // ---------------------------------------------------------------- 01467 01468 // Write the "FROM" portion of the query 01469 01470 if (count($this->ar_from) > 0) 01471 { 01472 $sql .= "\nFROM "; 01473 01474 $sql .= $this->_from_tables($this->ar_from); 01475 } 01476 01477 // ---------------------------------------------------------------- 01478 01479 // Write the "JOIN" portion of the query 01480 01481 if (count($this->ar_join) > 0) 01482 { 01483 $sql .= "\n"; 01484 01485 $sql .= implode("\n", $this->ar_join); 01486 } 01487 01488 // ---------------------------------------------------------------- 01489 01490 // Write the "WHERE" portion of the query 01491 01492 if (count($this->ar_where) > 0 OR count($this->ar_like) > 0) 01493 { 01494 $sql .= "\n"; 01495 01496 $sql .= "WHERE "; 01497 } 01498 01499 $sql .= implode("\n", $this->ar_where); 01500 01501 // ---------------------------------------------------------------- 01502 01503 // Write the "LIKE" portion of the query 01504 01505 if (count($this->ar_like) > 0) 01506 { 01507 if (count($this->ar_where) > 0) 01508 { 01509 $sql .= "\nAND "; 01510 } 01511 01512 $sql .= implode("\n", $this->ar_like); 01513 } 01514 01515 // ---------------------------------------------------------------- 01516 01517 // Write the "GROUP BY" portion of the query 01518 01519 if (count($this->ar_groupby) > 0) 01520 { 01521 $sql .= "\nGROUP BY "; 01522 01523 $sql .= implode(', ', $this->ar_groupby); 01524 } 01525 01526 // ---------------------------------------------------------------- 01527 01528 // Write the "HAVING" portion of the query 01529 01530 if (count($this->ar_having) > 0) 01531 { 01532 $sql .= "\nHAVING "; 01533 $sql .= implode("\n", $this->ar_having); 01534 } 01535 01536 // ---------------------------------------------------------------- 01537 01538 // Write the "ORDER BY" portion of the query 01539 01540 if (count($this->ar_orderby) > 0) 01541 { 01542 $sql .= "\nORDER BY "; 01543 $sql .= implode(', ', $this->ar_orderby); 01544 01545 if ($this->ar_order !== FALSE) 01546 { 01547 $sql .= ($this->ar_order == 'desc') ? ' DESC' : ' ASC'; 01548 } 01549 } 01550 01551 // ---------------------------------------------------------------- 01552 01553 // Write the "LIMIT" portion of the query 01554 01555 if (is_numeric($this->ar_limit)) 01556 { 01557 $sql .= "\n"; 01558 $sql = $this->_limit($sql, $this->ar_limit, $this->ar_offset); 01559 } 01560 01561 return $sql; 01562 }


| CI_DB_active_record::_create_alias_from_table | ( | $ | item | ) |
Determines the alias name based on the table.
private
| string |
Definition at line 228 of file DB_active_rec.php.
Referenced by _max_min_avg_sum().
00229 { 00230 if (strpos($item, '.') !== FALSE) 00231 { 00232 return end(explode('.', $item)); 00233 } 00234 00235 return $item; 00236 }

| CI_DB_active_record::_having | ( | $ | key, | |
| $ | value = '', |
|||
| $ | type = 'AND ', |
|||
| $ | escape = TRUE | |||
| ) |
Sets the HAVING values.
Called by having() or or_having()
private
| string | ||
| string |
Definition at line 818 of file DB_active_rec.php.
References CI_DB_driver::_has_operator(), and CI_DB_driver::_protect_identifiers().
Referenced by having(), and or_having().
00819 { 00820 if ( ! is_array($key)) 00821 { 00822 $key = array($key => $value); 00823 } 00824 00825 foreach ($key as $k => $v) 00826 { 00827 $prefix = (count($this->ar_having) == 0) ? '' : $type; 00828 00829 if ($escape === TRUE) 00830 { 00831 $k = $this->_protect_identifiers($k); 00832 } 00833 00834 if ( ! $this->_has_operator($k)) 00835 { 00836 $k .= ' = '; 00837 } 00838 00839 if ($v != '') 00840 { 00841 $v = ' '.$this->escape_str($v); 00842 } 00843 00844 $this->ar_having[] = $prefix.$k.$v; 00845 if ($this->ar_caching === TRUE) 00846 { 00847 $this->ar_cache_having[] = $prefix.$k.$v; 00848 $this->ar_cache_exists[] = 'having'; 00849 } 00850 } 00851 00852 return $this; 00853 }


| CI_DB_active_record::_like | ( | $ | field, | |
| $ | match = '', |
|||
| $ | type = 'AND ', |
|||
| $ | side = 'both', |
|||
| $ | not = '' | |||
| ) |
Like.
private
| mixed | ||
| mixed | ||
| string |
Definition at line 675 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers().
Referenced by like(), not_like(), or_like(), and or_not_like().
00676 { 00677 if ( ! is_array($field)) 00678 { 00679 $field = array($field => $match); 00680 } 00681 00682 foreach ($field as $k => $v) 00683 { 00684 $k = $this->_protect_identifiers($k); 00685 00686 $prefix = (count($this->ar_like) == 0) ? '' : $type; 00687 00688 $v = $this->escape_str($v); 00689 00690 if ($side == 'before') 00691 { 00692 $like_statement = $prefix." $k $not LIKE '%{$v}'"; 00693 } 00694 elseif ($side == 'after') 00695 { 00696 $like_statement = $prefix." $k $not LIKE '{$v}%'"; 00697 } 00698 else 00699 { 00700 $like_statement = $prefix." $k $not LIKE '%{$v}%'"; 00701 } 00702 00703 $this->ar_like[] = $like_statement; 00704 if ($this->ar_caching === TRUE) 00705 { 00706 $this->ar_cache_like[] = $like_statement; 00707 $this->ar_cache_exists[] = 'like'; 00708 } 00709 00710 } 00711 return $this; 00712 }


| CI_DB_active_record::_max_min_avg_sum | ( | $ | select = '', |
|
| $ | alias = '', |
|||
| $ | type = 'MAX' | |||
| ) |
Processing Function for the four functions above:.
select_max() select_min() select_avg() select_sum()
public
| string | the field | |
| string | an alias |
Definition at line 187 of file DB_active_rec.php.
References _create_alias_from_table(), CI_DB_driver::_protect_identifiers(), CI_DB_driver::display_error(), and show_error().
Referenced by select_avg(), select_max(), select_min(), and select_sum().
00188 { 00189 if ( ! is_string($select) OR $select == '') 00190 { 00191 $this->display_error('db_invalid_query'); 00192 } 00193 00194 $type = strtoupper($type); 00195 00196 if ( ! in_array($type, array('MAX', 'MIN', 'AVG', 'SUM'))) 00197 { 00198 show_error('Invalid function type: '.$type); 00199 } 00200 00201 if ($alias == '') 00202 { 00203 $alias = $this->_create_alias_from_table(trim($select)); 00204 } 00205 00206 $sql = $type.'('.$this->_protect_identifiers(trim($select)).') AS '.$alias; 00207 00208 $this->ar_select[] = $sql; 00209 00210 if ($this->ar_caching === TRUE) 00211 { 00212 $this->ar_cache_select[] = $sql; 00213 $this->ar_cache_exists[] = 'select'; 00214 } 00215 00216 return $this; 00217 }


| CI_DB_active_record::_merge_cache | ( | ) |
Merge Cache.
When called, this function merges any cached AR arrays with locally called ones.
private
Definition at line 1664 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers(), and _track_aliases().
Referenced by _compile_select(), delete(), and update().
01665 { 01666 if (count($this->ar_cache_exists) == 0) 01667 { 01668 return; 01669 } 01670 01671 foreach ($this->ar_cache_exists as $val) 01672 { 01673 $ar_variable = 'ar_'.$val; 01674 $ar_cache_var = 'ar_cache_'.$val; 01675 01676 if (count($this->$ar_cache_var) == 0) 01677 { 01678 continue; 01679 } 01680 01681 $this->$ar_variable = array_unique(array_merge($this->$ar_cache_var, $this->$ar_variable)); 01682 } 01683 01684 // If we are "protecting identifiers" we need to examine the "from" 01685 // portion of the query to determine if there are any aliases 01686 if ($this->_protect_identifiers === TRUE AND count($this->ar_cache_from) > 0) 01687 { 01688 $this->_track_aliases($this->ar_from); 01689 } 01690 }


| CI_DB_active_record::_object_to_array | ( | $ | object | ) |
Object to Array.
Takes an object as input and converts the class variables to array key/vals
public
| object |
Definition at line 1575 of file DB_active_rec.php.
Referenced by set().
01576 { 01577 if ( ! is_object($object)) 01578 { 01579 return $object; 01580 } 01581 01582 $array = array(); 01583 foreach (get_object_vars($object) as $key => $val) 01584 { 01585 // There are some built in keys we need to ignore for this conversion 01586 if ( ! is_object($val) && ! is_array($val) && $key != '_parent_name' && $key != '_ci_scaffolding' && $key != '_ci_scaff_table') 01587 { 01588 $array[$key] = $val; 01589 } 01590 } 01591 01592 return $array; 01593 }

| CI_DB_active_record::_reset_run | ( | $ | ar_reset_items | ) |
Resets the active record values.
Called by the get() function
private
| array | An array of fields to reset |
Definition at line 1701 of file DB_active_rec.php.
Referenced by _reset_select(), _reset_write(), and flush_cache().
01702 { 01703 foreach ($ar_reset_items as $item => $default_value) 01704 { 01705 if ( ! in_array($item, $this->ar_store_array)) 01706 { 01707 $this->$item = $default_value; 01708 } 01709 } 01710 }

| CI_DB_active_record::_reset_select | ( | ) |
Resets the active record values.
Called by the get() function
private
Definition at line 1720 of file DB_active_rec.php.
References _reset_run().
Referenced by count_all_results(), get(), and get_where().
01721 { 01722 $ar_reset_items = array( 01723 'ar_select' => array(), 01724 'ar_from' => array(), 01725 'ar_join' => array(), 01726 'ar_where' => array(), 01727 'ar_like' => array(), 01728 'ar_groupby' => array(), 01729 'ar_having' => array(), 01730 'ar_orderby' => array(), 01731 'ar_wherein' => array(), 01732 'ar_aliased_tables' => array(), 01733 'ar_distinct' => FALSE, 01734 'ar_limit' => FALSE, 01735 'ar_offset' => FALSE, 01736 'ar_order' => FALSE, 01737 ); 01738 01739 $this->_reset_run($ar_reset_items); 01740 }


| CI_DB_active_record::_reset_write | ( | ) |
Resets the active record "write" values.
Called by the insert() update() and delete() functions
private
Definition at line 1752 of file DB_active_rec.php.
References _reset_run().
Referenced by delete(), empty_table(), insert(), truncate(), and update().
01753 { 01754 $ar_reset_items = array( 01755 'ar_set' => array(), 01756 'ar_from' => array(), 01757 'ar_where' => array(), 01758 'ar_like' => array(), 01759 'ar_orderby' => array(), 01760 'ar_limit' => FALSE, 01761 'ar_order' => FALSE 01762 ); 01763 01764 $this->_reset_run($ar_reset_items); 01765 }


| CI_DB_active_record::_track_aliases | ( | $ | table | ) |
Track Aliases.
Used to track SQL statements written with aliased tables.
private
| string | The table to inspect |
Definition at line 1385 of file DB_active_rec.php.
Referenced by _merge_cache(), count_all_results(), from(), get(), and join().
01386 { 01387 if (is_array($table)) 01388 { 01389 foreach ($table as $t) 01390 { 01391 $this->_track_aliases($t); 01392 } 01393 return; 01394 } 01395 01396 // Does the string contain a comma? If so, we need to separate 01397 // the string into discreet statements 01398 if (strpos($table, ',') !== FALSE) 01399 { 01400 return $this->_track_aliases(explode(',', $table)); 01401 } 01402 01403 // if a table alias is used we can recognize it by a space 01404 if (strpos($table, " ") !== FALSE) 01405 { 01406 // if the alias is written with the AS keyword, remove it 01407 $table = preg_replace('/ AS /i', ' ', $table); 01408 01409 // Grab the alias 01410 $table = trim(strrchr($table, " ")); 01411 01412 // Store the alias, if it doesn't already exist 01413 if ( ! in_array($table, $this->ar_aliased_tables)) 01414 { 01415 $this->ar_aliased_tables[] = $table; 01416 } 01417 } 01418 }

| CI_DB_active_record::_where | ( | $ | key, | |
| $ | value = NULL, |
|||
| $ | type = 'AND ', |
|||
| $ | escape = NULL | |||
| ) |
Where.
Called by where() or orwhere()
private
| mixed | ||
| mixed | ||
| string |
Definition at line 402 of file DB_active_rec.php.
References CI_DB_driver::_has_operator(), and CI_DB_driver::_protect_identifiers().
Referenced by or_where(), and where().
00403 { 00404 if ( ! is_array($key)) 00405 { 00406 $key = array($key => $value); 00407 } 00408 00409 // If the escape value was not set will will base it on the global setting 00410 if ( ! is_bool($escape)) 00411 { 00412 $escape = $this->_protect_identifiers; 00413 } 00414 00415 foreach ($key as $k => $v) 00416 { 00417 $prefix = (count($this->ar_where) == 0 AND count($this->ar_cache_where) == 0) ? '' : $type; 00418 00419 if (is_null($v) && ! $this->_has_operator($k)) 00420 { 00421 // value appears not to have been set, assign the test to IS NULL 00422 $k .= ' IS NULL'; 00423 } 00424 00425 if ( ! is_null($v)) 00426 { 00427 if ($escape === TRUE) 00428 { 00429 $k = $this->_protect_identifiers($k, FALSE, $escape); 00430 00431 $v = ' '.$this->escape($v); 00432 } 00433 00434 if ( ! $this->_has_operator($k)) 00435 { 00436 $k .= ' ='; 00437 } 00438 } 00439 else 00440 { 00441 $k = $this->_protect_identifiers($k, FALSE, $escape); 00442 } 00443 00444 $this->ar_where[] = $prefix.$k.$v; 00445 00446 if ($this->ar_caching === TRUE) 00447 { 00448 $this->ar_cache_where[] = $prefix.$k.$v; 00449 $this->ar_cache_exists[] = 'where'; 00450 } 00451 00452 } 00453 00454 return $this; 00455 }


| CI_DB_active_record::_where_in | ( | $ | key = NULL, |
|
| $ | values = NULL, |
|||
| $ | not = FALSE, |
|||
| $ | type = 'AND ' | |||
| ) |
Where_in.
Called by where_in, where_in_or, where_not_in, where_not_in_or
public
| string | The field to search | |
| array | The values searched on | |
| boolean | If the statement would be IN or NOT IN | |
| string |
Definition at line 543 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers(), and CI_DB_driver::escape().
Referenced by or_where_in(), or_where_not_in(), where_in(), and where_not_in().
00544 { 00545 if ($key === NULL OR $values === NULL) 00546 { 00547 return; 00548 } 00549 00550 if ( ! is_array($values)) 00551 { 00552 $values = array($values); 00553 } 00554 00555 $not = ($not) ? ' NOT' : ''; 00556 00557 foreach ($values as $value) 00558 { 00559 $this->ar_wherein[] = $this->escape($value); 00560 } 00561 00562 $prefix = (count($this->ar_where) == 0) ? '' : $type; 00563 00564 $where_in = $prefix . $this->_protect_identifiers($key) . $not . " IN (" . implode(", ", $this->ar_wherein) . ") "; 00565 00566 $this->ar_where[] = $where_in; 00567 if ($this->ar_caching === TRUE) 00568 { 00569 $this->ar_cache_where[] = $where_in; 00570 $this->ar_cache_exists[] = 'where'; 00571 } 00572 00573 // reset the array for multiple calls 00574 $this->ar_wherein = array(); 00575 return $this; 00576 }


| CI_DB_active_record::count_all_results | ( | $ | table = '' |
) |
"Count All Results" query
Generates a platform-specific query string that counts all records returned by an Active Record query.
public
| string |
Definition at line 1017 of file DB_active_rec.php.
References _compile_select(), CI_DB_driver::_protect_identifiers(), _reset_select(), _track_aliases(), from(), and CI_DB_driver::query().
01018 { 01019 if ($table != '') 01020 { 01021 $this->_track_aliases($table); 01022 $this->from($table); 01023 } 01024 01025 $sql = $this->_compile_select($this->_count_string . $this->_protect_identifiers('numrows')); 01026 01027 $query = $this->query($sql); 01028 $this->_reset_select(); 01029 01030 if ($query->num_rows() == 0) 01031 { 01032 return '0'; 01033 } 01034 01035 $row = $query->row(); 01036 return $row->numrows; 01037 }

| CI_DB_active_record::dbprefix | ( | $ | table = '' |
) |
DB Prefix.
Prepends a database prefix if one exists in configuration
public
| string | the table |
Definition at line 1364 of file DB_active_rec.php.
References CI_DB_driver::display_error().
01365 { 01366 if ($table == '') 01367 { 01368 $this->display_error('db_table_name_required'); 01369 } 01370 01371 return $this->dbprefix.$table; 01372 }

| CI_DB_active_record::delete | ( | $ | table = '', |
|
| $ | where = '', |
|||
| $ | limit = NULL, |
|||
| $ | reset_data = TRUE | |||
| ) |
Delete.
Compiles a delete string and runs the query
public
| mixed | the table(s) to delete from. String or array | |
| mixed | the where clause | |
| mixed | the limit clause | |
| boolean |
Definition at line 1290 of file DB_active_rec.php.
References _merge_cache(), CI_DB_driver::_protect_identifiers(), _reset_write(), CI_DB_driver::display_error(), limit(), CI_DB_driver::query(), and where().
01291 { 01292 // Combine any cached components with the current statements 01293 $this->_merge_cache(); 01294 01295 if ($table == '') 01296 { 01297 if ( ! isset($this->ar_from[0])) 01298 { 01299 if ($this->db_debug) 01300 { 01301 return $this->display_error('db_must_set_table'); 01302 } 01303 return FALSE; 01304 } 01305 01306 $table = $this->ar_from[0]; 01307 } 01308 elseif (is_array($table)) 01309 { 01310 foreach($table as $single_table) 01311 { 01312 $this->delete($single_table, $where, $limit, FALSE); 01313 } 01314 01315 $this->_reset_write(); 01316 return; 01317 } 01318 else 01319 { 01320 $table = $this->_protect_identifiers($table, TRUE, NULL, FALSE); 01321 } 01322 01323 if ($where != '') 01324 { 01325 $this->where($where); 01326 } 01327 01328 if ($limit != NULL) 01329 { 01330 $this->limit($limit); 01331 } 01332 01333 if (count($this->ar_where) == 0 && count($this->ar_like) == 0) 01334 { 01335 if ($this->db_debug) 01336 { 01337 return $this->display_error('db_del_must_use_where'); 01338 } 01339 01340 return FALSE; 01341 } 01342 01343 $sql = $this->_delete($table, $this->ar_where, $this->ar_like, $this->ar_limit); 01344 01345 if ($reset_data) 01346 { 01347 $this->_reset_write(); 01348 } 01349 01350 return $this->query($sql); 01351 }

| CI_DB_active_record::distinct | ( | $ | val = TRUE |
) |
DISTINCT.
Sets a flag which tells the query string compiler to add DISTINCT
public
| bool |
Definition at line 249 of file DB_active_rec.php.
| CI_DB_active_record::empty_table | ( | $ | table = '' |
) |
Empty Table.
Compiles a delete string and runs "DELETE FROM table"
public
| string | the table to empty |
Definition at line 1209 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers(), _reset_write(), CI_DB_driver::display_error(), and CI_DB_driver::query().
01210 { 01211 if ($table == '') 01212 { 01213 if ( ! isset($this->ar_from[0])) 01214 { 01215 if ($this->db_debug) 01216 { 01217 return $this->display_error('db_must_set_table'); 01218 } 01219 return FALSE; 01220 } 01221 01222 $table = $this->ar_from[0]; 01223 } 01224 else 01225 { 01226 $table = $this->_protect_identifiers($table, TRUE, NULL, FALSE); 01227 } 01228 01229 $sql = $this->_delete($table); 01230 01231 $this->_reset_write(); 01232 01233 return $this->query($sql); 01234 }

| CI_DB_active_record::flush_cache | ( | ) |
Flush Cache.
Empties the AR cache
public
Definition at line 1635 of file DB_active_rec.php.
References _reset_run().
01636 { 01637 $this->_reset_run( 01638 array( 01639 'ar_cache_select' => array(), 01640 'ar_cache_from' => array(), 01641 'ar_cache_join' => array(), 01642 'ar_cache_where' => array(), 01643 'ar_cache_like' => array(), 01644 'ar_cache_groupby' => array(), 01645 'ar_cache_having' => array(), 01646 'ar_cache_orderby' => array(), 01647 'ar_cache_set' => array(), 01648 'ar_cache_exists' => array() 01649 ) 01650 ); 01651 }

| CI_DB_active_record::from | ( | $ | from | ) |
From.
Generates the FROM portion of the query
public
| mixed | can be a string or array |
Definition at line 266 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers(), and _track_aliases().
Referenced by count_all_results(), get(), and get_where().
00267 { 00268 foreach ((array)$from as $val) 00269 { 00270 // Extract any aliases that might exist. We use this information 00271 // in the _protect_identifiers to know whether to add a table prefix 00272 $this->_track_aliases($val); 00273 00274 $this->ar_from[] = $this->_protect_identifiers($val, TRUE, NULL, FALSE); 00275 00276 if ($this->ar_caching === TRUE) 00277 { 00278 $this->ar_cache_from[] = $this->_protect_identifiers($val, TRUE, NULL, FALSE); 00279 $this->ar_cache_exists[] = 'from'; 00280 } 00281 } 00282 00283 return $this; 00284 }


| CI_DB_active_record::get | ( | $ | table = '', |
|
| $ | limit = null, |
|||
| $ | offset = null | |||
| ) |
Get.
Compiles the select statement based on the other functions called and runs the query
public
| string | the table | |
| string | the limit clause | |
| string | the offset clause |
Definition at line 987 of file DB_active_rec.php.
References _compile_select(), _reset_select(), _track_aliases(), from(), limit(), and CI_DB_driver::query().
00988 { 00989 if ($table != '') 00990 { 00991 $this->_track_aliases($table); 00992 $this->from($table); 00993 } 00994 00995 if ( ! is_null($limit)) 00996 { 00997 $this->limit($limit, $offset); 00998 } 00999 01000 $sql = $this->_compile_select(); 01001 01002 $result = $this->query($sql); 01003 $this->_reset_select(); 01004 return $result; 01005 }

| CI_DB_active_record::get_where | ( | $ | table = '', |
|
| $ | where = null, |
|||
| $ | limit = null, |
|||
| $ | offset = null | |||
| ) |
Get_Where.
Allows the where clause, limit and offset to be added directly
public
| string | the where clause | |
| string | the limit clause | |
| string | the offset clause |
Definition at line 1052 of file DB_active_rec.php.
References _compile_select(), _reset_select(), from(), limit(), CI_DB_driver::query(), and where().
Referenced by getwhere().
01053 { 01054 if ($table != '') 01055 { 01056 $this->from($table); 01057 } 01058 01059 if ( ! is_null($where)) 01060 { 01061 $this->where($where); 01062 } 01063 01064 if ( ! is_null($limit)) 01065 { 01066 $this->limit($limit, $offset); 01067 } 01068 01069 $sql = $this->_compile_select(); 01070 01071 $result = $this->query($sql); 01072 $this->_reset_select(); 01073 return $result; 01074 }


| CI_DB_active_record::getwhere | ( | $ | table = '', |
|
| $ | where = null, |
|||
| $ | limit = null, |
|||
| $ | offset = null | |||
| ) |
getwhere() is an alias of get_where() this function is here for backwards compatibility, as getwhere() has been deprecated
Definition at line 1083 of file DB_active_rec.php.
References get_where().
01084 { 01085 return $this->get_where($table, $where, $limit, $offset); 01086 }

| CI_DB_active_record::group_by | ( | $ | by | ) |
GROUP BY.
public
| string |
Definition at line 723 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers().
Referenced by groupby().
00724 { 00725 if (is_string($by)) 00726 { 00727 $by = explode(',', $by); 00728 } 00729 00730 foreach ($by as $val) 00731 { 00732 $val = trim($val); 00733 00734 if ($val != '') 00735 { 00736 $this->ar_groupby[] = $this->_protect_identifiers($val); 00737 00738 if ($this->ar_caching === TRUE) 00739 { 00740 $this->ar_cache_groupby[] = $this->_protect_identifiers($val); 00741 $this->ar_cache_exists[] = 'groupby'; 00742 } 00743 } 00744 } 00745 return $this; 00746 }


| CI_DB_active_record::groupby | ( | $ | by | ) |
groupby() is an alias of group_by() this function is here for backwards compatibility, as groupby() has been deprecated
Definition at line 755 of file DB_active_rec.php.
References group_by().
00756 { 00757 return $this->group_by($by); 00758 }

| CI_DB_active_record::having | ( | $ | key, | |
| $ | value = '', |
|||
| $ | escape = TRUE | |||
| ) |
Sets the HAVING value.
Separates multiple calls with AND
public
| string | ||
| string |
Definition at line 772 of file DB_active_rec.php.
References _having().
00773 { 00774 return $this->_having($key, $value, 'AND ', $escape); 00775 }

| CI_DB_active_record::insert | ( | $ | table = '', |
|
| $ | set = NULL | |||
| ) |
Insert.
Compiles an insert string and runs the query
public
| string | the table to retrieve the results from | |
| array | an associative array of insert values |
Definition at line 1100 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers(), _reset_write(), CI_DB_driver::display_error(), and CI_DB_driver::query().
01101 { 01102 if ( ! is_null($set)) 01103 { 01104 $this->set($set); 01105 } 01106 01107 if (count($this->ar_set) == 0) 01108 { 01109 if ($this->db_debug) 01110 { 01111 return $this->display_error('db_must_use_set'); 01112 } 01113 return FALSE; 01114 } 01115 01116 if ($table == '') 01117 { 01118 if ( ! isset($this->ar_from[0])) 01119 { 01120 if ($this->db_debug) 01121 { 01122 return $this->display_error('db_must_set_table'); 01123 } 01124 return FALSE; 01125 } 01126 01127 $table = $this->ar_from[0]; 01128 } 01129 01130 $sql = $this->_insert($this->_protect_identifiers($table, TRUE, NULL, FALSE), array_keys($this->ar_set), array_values($this->ar_set)); 01131 01132 $this->_reset_write(); 01133 return $this->query($sql); 01134 }

| CI_DB_active_record::join | ( | $ | table, | |
| $ | cond, | |||
| $ | type = '' | |||
| ) |
Join.
Generates the JOIN portion of the query
public
| string | ||
| string | the join condition | |
| string | the type of join |
Definition at line 299 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers(), and _track_aliases().
00300 { 00301 if ($type != '') 00302 { 00303 $type = strtoupper(trim($type)); 00304 00305 if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'))) 00306 { 00307 $type = ''; 00308 } 00309 else 00310 { 00311 $type .= ' '; 00312 } 00313 } 00314 00315 // Extract any aliases that might exist. We use this information 00316 // in the _protect_identifiers to know whether to add a table prefix 00317 $this->_track_aliases($table); 00318 00319 // Strip apart the condition and protect the identifiers 00320 if (preg_match('/([\w\.]+)([\W\s]+)(.+)/', $cond, $match)) 00321 { 00322 $match[1] = $this->_protect_identifiers($match[1]); 00323 $match[3] = $this->_protect_identifiers($match[3]); 00324 00325 $cond = $match[1].$match[2].$match[3]; 00326 } 00327 00328 // Assemble the JOIN statement 00329 $join = $type.'JOIN '.$this->_protect_identifiers($table, TRUE, NULL, FALSE).' ON '.$cond; 00330 00331 $this->ar_join[] = $join; 00332 if ($this->ar_caching === TRUE) 00333 { 00334 $this->ar_cache_join[] = $join; 00335 $this->ar_cache_exists[] = 'join'; 00336 } 00337 00338 return $this; 00339 }

| CI_DB_active_record::like | ( | $ | field, | |
| $ | match = '', |
|||
| $ | side = 'both' | |||
| ) |
Like.
Generates a LIKE% portion of the query. Separates multiple calls with AND
public
| mixed | ||
| mixed |
Definition at line 591 of file DB_active_rec.php.
References _like().
00592 { 00593 return $this->_like($field, $match, 'AND ', $side); 00594 }

| CI_DB_active_record::limit | ( | $ | value, | |
| $ | offset = '' | |||
| ) |
Sets the LIMIT value.
public
| integer | the limit value | |
| integer | the offset value |
Definition at line 911 of file DB_active_rec.php.
Referenced by delete(), get(), get_where(), and update().
00912 { 00913 $this->ar_limit = $value; 00914 00915 if ($offset != '') 00916 { 00917 $this->ar_offset = $offset; 00918 } 00919 00920 return $this; 00921 }

| CI_DB_active_record::not_like | ( | $ | field, | |
| $ | match = '', |
|||
| $ | side = 'both' | |||
| ) |
Not Like.
Generates a NOT LIKE portion of the query. Separates multiple calls with AND
public
| mixed | ||
| mixed |
Definition at line 609 of file DB_active_rec.php.
References _like().
00610 { 00611 return $this->_like($field, $match, 'AND ', $side, 'NOT'); 00612 }

| CI_DB_active_record::offset | ( | $ | offset | ) |
Sets the OFFSET value.
public
| integer | the offset value |
Definition at line 932 of file DB_active_rec.php.
| CI_DB_active_record::or_having | ( | $ | key, | |
| $ | value = '', |
|||
| $ | escape = TRUE | |||
| ) |
Sets the OR HAVING value.
Separates multiple calls with OR
public
| string | ||
| string |
Definition at line 801 of file DB_active_rec.php.
References _having().
Referenced by orhaving().
00802 { 00803 return $this->_having($key, $value, 'OR ', $escape); 00804 }


| CI_DB_active_record::or_like | ( | $ | field, | |
| $ | match = '', |
|||
| $ | side = 'both' | |||
| ) |
OR Like.
Generates a LIKE% portion of the query. Separates multiple calls with OR
public
| mixed | ||
| mixed |
Definition at line 627 of file DB_active_rec.php.
References _like().
Referenced by orlike().
00628 { 00629 return $this->_like($field, $match, 'OR ', $side); 00630 }


| CI_DB_active_record::or_not_like | ( | $ | field, | |
| $ | match = '', |
|||
| $ | side = 'both' | |||
| ) |
OR Not Like.
Generates a NOT LIKE portion of the query. Separates multiple calls with OR
public
| mixed | ||
| mixed |
Definition at line 645 of file DB_active_rec.php.
References _like().
00646 { 00647 return $this->_like($field, $match, 'OR ', $side, 'NOT'); 00648 }

| CI_DB_active_record::or_where | ( | $ | key, | |
| $ | value = NULL, |
|||
| $ | escape = TRUE | |||
| ) |
OR Where.
Generates the WHERE portion of the query. Separates multiple calls with OR
public
| mixed | ||
| mixed |
Definition at line 372 of file DB_active_rec.php.
References _where().
Referenced by orwhere().
00373 { 00374 return $this->_where($key, $value, 'OR ', $escape); 00375 }


| CI_DB_active_record::or_where_in | ( | $ | key = NULL, |
|
| $ | values = NULL | |||
| ) |
Where_in_or.
Generates a WHERE field IN ('item', 'item') SQL query joined with OR if appropriate
public
| string | The field to search | |
| array | The values searched on |
Definition at line 488 of file DB_active_rec.php.
References _where_in().
00489 { 00490 return $this->_where_in($key, $values, FALSE, 'OR '); 00491 }

| CI_DB_active_record::or_where_not_in | ( | $ | key = NULL, |
|
| $ | values = NULL | |||
| ) |
Where_not_in_or.
Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR if appropriate
public
| string | The field to search | |
| array | The values searched on |
Definition at line 524 of file DB_active_rec.php.
References _where_in().
00525 { 00526 return $this->_where_in($key, $values, TRUE, 'OR '); 00527 }

| CI_DB_active_record::order_by | ( | $ | orderby, | |
| $ | direction = '' | |||
| ) |
Sets the ORDER BY value.
public
| string | ||
| string | direction: asc or desc |
Definition at line 865 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers().
Referenced by orderby().
00866 { 00867 if (strtolower($direction) == 'random') 00868 { 00869 $orderby = ''; // Random results want or don't need a field name 00870 $direction = $this->_random_keyword; 00871 } 00872 elseif (trim($direction) != '') 00873 { 00874 $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' '.$direction : ' ASC'; 00875 } 00876 00877 $orderby_statement = $this->_protect_identifiers($orderby).$direction; 00878 00879 $this->ar_orderby[] = $orderby_statement; 00880 if ($this->ar_caching === TRUE) 00881 { 00882 $this->ar_cache_orderby[] = $orderby_statement; 00883 $this->ar_cache_exists[] = 'orderby'; 00884 } 00885 00886 return $this; 00887 }


| CI_DB_active_record::orderby | ( | $ | orderby, | |
| $ | direction = '' | |||
| ) |
orderby() is an alias of order_by() this function is here for backwards compatibility, as orderby() has been deprecated
Definition at line 896 of file DB_active_rec.php.
References order_by().
00897 { 00898 return $this->order_by($orderby, $direction); 00899 }

| CI_DB_active_record::orhaving | ( | $ | key, | |
| $ | value = '', |
|||
| $ | escape = TRUE | |||
| ) |
orhaving() is an alias of or_having() this function is here for backwards compatibility, as orhaving() has been deprecated
Definition at line 785 of file DB_active_rec.php.
References or_having().
00786 { 00787 return $this->or_having($key, $value, $escape); 00788 }

| CI_DB_active_record::orlike | ( | $ | field, | |
| $ | match = '', |
|||
| $ | side = 'both' | |||
| ) |
| CI_DB_active_record::orwhere | ( | $ | key, | |
| $ | value = NULL, |
|||
| $ | escape = TRUE | |||
| ) |
orwhere() is an alias of or_where() this function is here for backwards compatibility, as orwhere() has been deprecated
Definition at line 384 of file DB_active_rec.php.
References or_where().
00385 { 00386 return $this->or_where($key, $value, $escape); 00387 }

| CI_DB_active_record::select | ( | $ | select = '*', |
|
| $ | escape = NULL | |||
| ) |
Select.
Generates the SELECT portion of the query
public
| string |
Definition at line 73 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers().
00074 { 00075 // Set the global value if this was sepecified 00076 if (is_bool($escape)) 00077 { 00078 $this->_protect_identifiers = $escape; 00079 } 00080 00081 if (is_string($select)) 00082 { 00083 $select = explode(',', $select); 00084 } 00085 00086 foreach ($select as $val) 00087 { 00088 $val = trim($val); 00089 00090 if ($val != '') 00091 { 00092 $this->ar_select[] = $val; 00093 00094 if ($this->ar_caching === TRUE) 00095 { 00096 $this->ar_cache_select[] = $val; 00097 $this->ar_cache_exists[] = 'select'; 00098 } 00099 } 00100 } 00101 return $this; 00102 }

| CI_DB_active_record::select_avg | ( | $ | select = '', |
|
| $ | alias = '' | |||
| ) |
Select Average.
Generates a SELECT AVG(field) portion of a query
public
| string | the field | |
| string | an alias |
Definition at line 150 of file DB_active_rec.php.
References _max_min_avg_sum().
00151 { 00152 return $this->_max_min_avg_sum($select, $alias, 'AVG'); 00153 }

| CI_DB_active_record::select_max | ( | $ | select = '', |
|
| $ | alias = '' | |||
| ) |
Select Max.
Generates a SELECT MAX(field) portion of a query
public
| string | the field | |
| string | an alias |
Definition at line 116 of file DB_active_rec.php.
References _max_min_avg_sum().
00117 { 00118 return $this->_max_min_avg_sum($select, $alias, 'MAX'); 00119 }

| CI_DB_active_record::select_min | ( | $ | select = '', |
|
| $ | alias = '' | |||
| ) |
Select Min.
Generates a SELECT MIN(field) portion of a query
public
| string | the field | |
| string | an alias |
Definition at line 133 of file DB_active_rec.php.
References _max_min_avg_sum().
00134 { 00135 return $this->_max_min_avg_sum($select, $alias, 'MIN'); 00136 }

| CI_DB_active_record::select_sum | ( | $ | select = '', |
|
| $ | alias = '' | |||
| ) |
Select Sum.
Generates a SELECT SUM(field) portion of a query
public
| string | the field | |
| string | an alias |
Definition at line 167 of file DB_active_rec.php.
References _max_min_avg_sum().
00168 { 00169 return $this->_max_min_avg_sum($select, $alias, 'SUM'); 00170 }

| CI_DB_active_record::set | ( | $ | key, | |
| $ | value = '', |
|||
| $ | escape = TRUE | |||
| ) |
The "set" function.
Allows key/value pairs to be set for inserting or updating
public
| mixed | ||
| string | ||
| boolean |
Definition at line 949 of file DB_active_rec.php.
References _object_to_array(), CI_DB_driver::_protect_identifiers(), and CI_DB_driver::escape().
00950 { 00951 $key = $this->_object_to_array($key); 00952 00953 if ( ! is_array($key)) 00954 { 00955 $key = array($key => $value); 00956 } 00957 00958 foreach ($key as $k => $v) 00959 { 00960 if ($escape === FALSE) 00961 { 00962 $this->ar_set[$this->_protect_identifiers($k)] = $v; 00963 } 00964 else 00965 { 00966 $this->ar_set[$this->_protect_identifiers($k)] = $this->escape($v); 00967 } 00968 } 00969 00970 return $this; 00971 }

| CI_DB_active_record::start_cache | ( | ) |
Start Cache.
Starts AR caching
public
Definition at line 1605 of file DB_active_rec.php.
| CI_DB_active_record::stop_cache | ( | ) |
| CI_DB_active_record::truncate | ( | $ | table = '' |
) |
Truncate.
Compiles a truncate string and runs the query If the database does not support the truncate() command This function maps to "DELETE FROM table"
public
| string | the table to truncate |
Definition at line 1249 of file DB_active_rec.php.
References CI_DB_driver::_protect_identifiers(), _reset_write(), CI_DB_driver::display_error(), and CI_DB_driver::query().
01250 { 01251 if ($table == '') 01252 { 01253 if ( ! isset($this->ar_from[0])) 01254 { 01255 if ($this->db_debug) 01256 { 01257 return $this->display_error('db_must_set_table'); 01258 } 01259 return FALSE; 01260 } 01261 01262 $table = $this->ar_from[0]; 01263 } 01264 else 01265 { 01266 $table = $this->_protect_identifiers($table, TRUE, NULL, FALSE); 01267 } 01268 01269 $sql = $this->_truncate($table); 01270 01271 $this->_reset_write(); 01272 01273 return $this->query($sql); 01274 }

| CI_DB_active_record::update | ( | $ | table = '', |
|
| $ | set = NULL, |
|||
| $ | where = NULL, |
|||
| $ | limit = NULL | |||
| ) |
Update.
Compiles an update string and runs the query
public
| string | the table to retrieve the results from | |
| array | an associative array of update values | |
| mixed | the where clause |
Definition at line 1149 of file DB_active_rec.php.
References _merge_cache(), CI_DB_driver::_protect_identifiers(), _reset_write(), CI_DB_driver::display_error(), limit(), CI_DB_driver::query(), and where().
01150 { 01151 // Combine any cached components with the current statements 01152 $this->_merge_cache(); 01153 01154 if ( ! is_null($set)) 01155 { 01156 $this->set($set); 01157 } 01158 01159 if (count($this->ar_set) == 0) 01160 { 01161 if ($this->db_debug) 01162 { 01163 return $this->display_error('db_must_use_set'); 01164 } 01165 return FALSE; 01166 } 01167 01168 if ($table == '') 01169 { 01170 if ( ! isset($this->ar_from[0])) 01171 { 01172 if ($this->db_debug) 01173 { 01174 return $this->display_error('db_must_set_table'); 01175 } 01176 return FALSE; 01177 } 01178 01179 $table = $this->ar_from[0]; 01180 } 01181 01182 if ($where != NULL) 01183 { 01184 $this->where($where); 01185 } 01186 01187 if ($limit != NULL) 01188 { 01189 $this->limit($limit); 01190 } 01191 01192 $sql = $this->_update($this->_protect_identifiers($table, TRUE, NULL, FALSE), $this->ar_set, $this->ar_where, $this->ar_orderby, $this->ar_limit); 01193 01194 $this->_reset_write(); 01195 return $this->query($sql); 01196 }

| CI_DB_active_record::where | ( | $ | key, | |
| $ | value = NULL, |
|||
| $ | escape = TRUE | |||
| ) |
Where.
Generates the WHERE portion of the query. Separates multiple calls with AND
public
| mixed | ||
| mixed |
Definition at line 354 of file DB_active_rec.php.
References _where().
Referenced by delete(), get_where(), and update().
00355 { 00356 return $this->_where($key, $value, 'AND ', $escape); 00357 }


| CI_DB_active_record::where_in | ( | $ | key = NULL, |
|
| $ | values = NULL | |||
| ) |
Where_in.
Generates a WHERE field IN ('item', 'item') SQL query joined with AND if appropriate
public
| string | The field to search | |
| array | The values searched on |
Definition at line 470 of file DB_active_rec.php.
References _where_in().
00471 { 00472 return $this->_where_in($key, $values); 00473 }

| CI_DB_active_record::where_not_in | ( | $ | key = NULL, |
|
| $ | values = NULL | |||
| ) |
Where_not_in.
Generates a WHERE field NOT IN ('item', 'item') SQL query joined with AND if appropriate
public
| string | The field to search | |
| array | The values searched on |
Definition at line 506 of file DB_active_rec.php.
References _where_in().
00507 { 00508 return $this->_where_in($key, $values, TRUE); 00509 }

| CI_DB_active_record::$ar_aliased_tables = array() |
Definition at line 45 of file DB_active_rec.php.
| CI_DB_active_record::$ar_cache_exists = array() |
Definition at line 50 of file DB_active_rec.php.
| CI_DB_active_record::$ar_cache_from = array() |
Definition at line 52 of file DB_active_rec.php.
| CI_DB_active_record::$ar_cache_groupby = array() |
Definition at line 56 of file DB_active_rec.php.
| CI_DB_active_record::$ar_cache_having = array() |
Definition at line 57 of file DB_active_rec.php.
| CI_DB_active_record::$ar_cache_join = array() |
Definition at line 53 of file DB_active_rec.php.
| CI_DB_active_record::$ar_cache_like = array() |
Definition at line 55 of file DB_active_rec.php.
| CI_DB_active_record::$ar_cache_orderby = array() |
Definition at line 58 of file DB_active_rec.php.
| CI_DB_active_record::$ar_cache_select = array() |
Definition at line 51 of file DB_active_rec.php.
| CI_DB_active_record::$ar_cache_set = array() |
Definition at line 59 of file DB_active_rec.php.
| CI_DB_active_record::$ar_cache_where = array() |
Definition at line 54 of file DB_active_rec.php.
| CI_DB_active_record::$ar_caching = FALSE |
Definition at line 49 of file DB_active_rec.php.
| CI_DB_active_record::$ar_distinct = FALSE |
Definition at line 32 of file DB_active_rec.php.
| CI_DB_active_record::$ar_from = array() |
Definition at line 33 of file DB_active_rec.php.
| CI_DB_active_record::$ar_groupby = array() |
Definition at line 37 of file DB_active_rec.php.
| CI_DB_active_record::$ar_having = array() |
Definition at line 38 of file DB_active_rec.php.
| CI_DB_active_record::$ar_join = array() |
Definition at line 34 of file DB_active_rec.php.
| CI_DB_active_record::$ar_like = array() |
Definition at line 36 of file DB_active_rec.php.
| CI_DB_active_record::$ar_limit = FALSE |
Definition at line 39 of file DB_active_rec.php.
| CI_DB_active_record::$ar_offset = FALSE |
Definition at line 40 of file DB_active_rec.php.
| CI_DB_active_record::$ar_order = FALSE |
Definition at line 41 of file DB_active_rec.php.
| CI_DB_active_record::$ar_orderby = array() |
Definition at line 42 of file DB_active_rec.php.
| CI_DB_active_record::$ar_select = array() |
Definition at line 31 of file DB_active_rec.php.
| CI_DB_active_record::$ar_set = array() |
Definition at line 43 of file DB_active_rec.php.
| CI_DB_active_record::$ar_store_array = array() |
Definition at line 46 of file DB_active_rec.php.
| CI_DB_active_record::$ar_where = array() |
Definition at line 35 of file DB_active_rec.php.
| CI_DB_active_record::$ar_wherein = array() |
Definition at line 44 of file DB_active_rec.php.