src/libraries/adapters/DatabaseMySql.php
/**
   * Explode params associative array into SQL insert statement lists
   * Return an array with 'cols' and 'vals'
   */
Explode params associative array into SQL insert statement lists
Return an array with 'cols' and 'vals'
Explode params associative array into SQL insert statement lists Return an array with ' cols ' and ' vals '
private function sqlInsertExplode($params, $bindings = array())
  {
    $stmt = array('cols' => '', 'vals' => '');
    foreach($params as $key => $value)
    {
      if($key == '::bindings')
        continue;
      if(!empty($stmt['cols']))
        $stmt['cols'] .= ",";
      if(!empty($stmt['vals']))
        $stmt['vals'] .= ",";
      $stmt['cols'] .= $key;
      if(!empty($bindings) && array_key_exists($value, $bindings))
      {
        if(is_null($value))
          $stmt['vals'] .= 'NULL';
        else
          $stmt['vals'] .= $value;
      }
      else
      {
        if(is_null($value))
          $stmt['vals'] .= 'NULL';
        else
          $stmt['vals'] .= sprintf("'%s'", $this->_($value));
      }
    }
    return $stmt;
  }
private function sqlInsertExplode ( $ params , $ bindings = array ( ) ) { $ stmt = array ( 'cols' => '' , 'vals' => '' ) ; foreach ( $ params as $ key => $ value ) { if ( $ key == '::bindings' ) continue ; if ( ! empty ( $ stmt [ 'cols' ] ) ) $ stmt [ 'cols' ] .= " , " ; if ( ! empty ( $ stmt [ 'vals' ] ) ) $ stmt [ 'vals' ] .= " , " ; $ stmt [ 'cols' ] .= $ key ; if ( ! empty ( $ bindings ) && array_key_exists ( $ value , $ bindings ) ) { if ( is_null ( $ value ) ) $ stmt [ 'vals' ] .= 'NULL' ; else $ stmt [ 'vals' ] .= $ value ; } else { if ( is_null ( $ value ) ) $ stmt [ 'vals' ] .= 'NULL' ; else $ stmt [ 'vals' ] .= sprintf ( " '%s' " , $ this -> _ ( $ value ) ) ; } } return $ stmt ; }
Explode params associative array into SQL insert statement lists
 Return an array with 'cols' and 'vals'
Explode params associative array into SQL insert statement lists Return an array with ' cols ' and ' vals '