Options

wherein = array('column'=>array('value1', 'value2'))

 emulates SQL IN:  column IN ('value1', 'value')

  • available to getOne() and select() functions
  • column values can be all strings or all integers
  • it resets after each function call
    
    // Example 1   [controllers/controller] - PHP wherein function

    $this->model->db->wherein = array('status' => array('PENDING','TESTING','IMPORTANT'));
    $this->view->rs_tasks     = $this->model->db->select('tasks', array('userid'=>$userid), $sel='*' );

    
whereor = array('col1'=>'value1', 'col2'=>0)

 emulates SQL OR:  col1 = 'value1' OR col2 = 0

  • available to getOne() and select() functions
  • cannot use the same column name more than once
  • it resets after each function call
    
    // Example 1   [controllers/controller] - PHP whereor function

    $this->model->db->whereor = array('status'=>'PENDING', 'seq'=>0);
    $this->view->rs_tasks     = $this->model->db->select('tasks', array('userid'=>$userid), $sel='*' );

    
wherelike = array('col1'=>'%value1%', 'col2'=>'%value2')

 emulates SQL LIKE:  col1 LIKE '%value1%' OR col2 LIKE '%value2'

  • available to getOne() and select() functions
  • cannot use the same column name more than once
  • it resets after each function call
    
    // Example 1   [controllers/controller] - PHP wherelike function

    $this->model->db->wherelike = array('status'=>'%PENDING%');
    $this->view->rs_orders      = $this->model->db->select('orders', array('vendorid'=>$vendorid), $sel='*' );