CI_DB_active_record::where PHP Méthode

where() public méthode

Generates the WHERE portion of the query. Separates multiple calls with AND
public where ( $key, $value = NULL, $escape = TRUE ) : object
Résultat object
    function where($key, $value = NULL, $escape = TRUE)
    {
        return $this->_where($key, $value, 'AND ', $escape);
    }

Usage Example

Exemple #1
0
 /**
  * The actual function used for updating or interting a record
  *
  * @return bool
  */
 private final function _save_row()
 {
     //First run validation, and bail out if it fails
     if ($this->validate() == FALSE) {
         return FALSE;
     }
     $this->_set_row();
     if ($this->_isnew) {
         $this->db->insert($this->_table());
         $this->_data[$this->_id()] = $this->db->insert_id();
         $Return = $this->id() != NULL;
         if ($Return == true) {
             $this->_isnew = false;
             $Record = new stdClass();
             foreach ($this->_data as $K => $V) {
                 $Record->{$K} = $V;
             }
             $this->_original_record = $Record;
         }
         return $Return;
     } else {
         $this->db->where($this->_id(), $this->id());
         $this->db->update($this->_forged_join());
         //Just in case  a join has been forged
         $this->_clear_forged_join();
         if ($this->_record_is_changed()) {
             return $this->db->affected_rows() > 0;
         }
         return true;
     }
 }
All Usage Examples Of CI_DB_active_record::where