original_string: public function update(array $options=array()) {
  		$options += self::$updateDefaults;
  		if( empty($options['table']) ) {
  			throw new Exception('Empty table option');
  		}
  		if( empty($options['what']) ) {
  			throw new Exception('No field');
  		}
  		$OPTIONS	= '';
  		$OPTIONS	.= (!empty($options['lowpriority'])) ? ' LOW_PRIORITY' : '';
  		$OPTIONS	.= (!empty($options['ignore'])) ? ' IGNORE' : '';
  		
  // 		if( is_array($options['what']) ) {
  // 			$string	= '';
  // 			foreach( $options['what'] as $key => $value ) {
  // 				$string .= ($string ? ', ' : '').static::escapeIdentifier($key).'='.static::formatValue($value);
  // 			}
  // 			$options['what'] = $string;
  // 		}
  		
  		$WHAT		= $this->formatFieldList($options['what']);
  		$WC			= ( !empty($options['where']) ) ? 'WHERE '.$options['where'] : '';
  		$ORDERBY	= ( !empty($options['orderby']) ) ? 'ORDER BY '.$options['orderby'] : '';
  		$LIMIT		= ( $options['number'] > 0 ) ? 'LIMIT '.
  				( ($options['offset'] > 0) ? $options['offset'].', ' : '' ).$options['number'] : '';
  		$TABLE		= static::escapeIdentifier($options['table']);
  	
  		$QUERY		= "UPDATE {$OPTIONS} {$TABLE} SET {$WHAT} {$WC} {$ORDERBY} {$LIMIT}";
  		if( $options['output'] == static::SQLQUERY ) {
  			return $QUERY;
  		}
  		return $this->query($QUERY, PDOEXEC);
  	}
code: public function update(array $options=array()) {
  		$options += self::$updateDefaults;
  		if( empty($options['table']) ) {
  			throw new Exception('Empty table option');
  		}
  		if( empty($options['what']) ) {
  			throw new Exception('No field');
  		}
  		$OPTIONS	= '';
  		$OPTIONS	.= (!empty($options['lowpriority'])) ? ' LOW_PRIORITY' : '';
  		$OPTIONS	.= (!empty($options['ignore'])) ? ' IGNORE' : '';
  		
  // 		if( is_array($options['what']) ) {
  // 			$string	= '';
  // 			foreach( $options['what'] as $key => $value ) {
  // 				$string .= ($string ? ', ' : '').static::escapeIdentifier($key).'='.static::formatValue($value);
  // 			}
  // 			$options['what'] = $string;
  // 		}
  		
  		$WHAT		= $this->formatFieldList($options['what']);
  		$WC			= ( !empty($options['where']) ) ? 'WHERE '.$options['where'] : '';
  		$ORDERBY	= ( !empty($options['orderby']) ) ? 'ORDER BY '.$options['orderby'] : '';
  		$LIMIT		= ( $options['number'] > 0 ) ? 'LIMIT '.
  				( ($options['offset'] > 0) ? $options['offset'].', ' : '' ).$options['number'] : '';
  		$TABLE		= static::escapeIdentifier($options['table']);
  	
  		$QUERY		= "UPDATE {$OPTIONS} {$TABLE} SET {$WHAT} {$WC} {$ORDERBY} {$LIMIT}";
  		if( $options['output'] == static::SQLQUERY ) {
  			return $QUERY;
  		}
  		return $this->query($QUERY, PDOEXEC);
  	}
code_tokens: public function update ( array $ options = array ( ) ) { $ options += self :: $ updateDefaults ; if ( empty ( $ options [ 'table' ] ) ) { throw new Exception ( 'Empty table option' ) ; } if ( empty ( $ options [ 'what' ] ) ) { throw new Exception ( 'No field' ) ; } $ OPTIONS = '' ; $ OPTIONS .= ( ! empty ( $ options [ 'lowpriority' ] ) ) ? ' LOW_PRIORITY' : '' ; $ OPTIONS .= ( ! empty ( $ options [ 'ignore' ] ) ) ? ' IGNORE' : '' ; // 		if( is_array($options['what']) ) { // 			$string	= ''; // 			foreach( $options['what'] as $key => $value ) { // 				$string .= ($string ? ', ' : '').static::escapeIdentifier($key).'='.static::formatValue($value); // 			} // 			$options['what'] = $string; // 		} $ WHAT = $ this -> formatFieldList ( $ options [ 'what' ] ) ; $ WC = ( ! empty ( $ options [ 'where' ] ) ) ? 'WHERE ' . $ options [ 'where' ] : '' ; $ ORDERBY = ( ! empty ( $ options [ 'orderby' ] ) ) ? 'ORDER BY ' . $ options [ 'orderby' ] : '' ; $ LIMIT = ( $ options [ 'number' ] > 0 ) ? 'LIMIT ' . ( ( $ options [ 'offset' ] > 0 ) ? $ options [ 'offset' ] . ', ' : '' ) . $ options [ 'number' ] : '' ; $ TABLE = static :: escapeIdentifier ( $ options [ 'table' ] ) ; $ QUERY = "UPDATE {$OPTIONS} {$TABLE} SET {$WHAT} {$WC} {$ORDERBY} {$LIMIT}" ; if ( $ options [ 'output' ] == static :: SQLQUERY ) { return $ QUERY ; } return $ this -> query ( $ QUERY , PDOEXEC ) ; }
docstring: Update something in database
  
  @param array $options The options used to build the query.
  @return int The number of affected rows.
  @see http://dev.mysql.com/doc/refman/5.0/en/update.html
  
  Using pdo_query(), It parses the query from an array to a UPDATE query.
docstring_tokens: Update something in database