public function insert(array $options=array()) {
		$options += self::$insertDefaults;
		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' : (!empty($options['delayed'])) ? ' DELAYED' : '';
		$OPTIONS .= (!empty($options['ignore'])) ? ' IGNORE' : '';
		$OPTIONS .= (!empty($options['into'])) ? ' INTO' : '';
		
		$COLS = $WHAT = '';
		//Is an array
		if( is_array($options['what']) ) {
			//Is an indexed array of fields Arrays
			if( !empty($options['what'][0]) ) {
				// Quoted as escapeIdentifier()
				$COLS = '(`'.implode('`, `', array_keys($options['what'][0])).'`)';
				foreach($options['what'] as $row) {
					$WHAT .= (!empty($WHAT) ? ', ' : '').'('.implode(', ', $row).')';
				}
				$WHAT	= 'VALUES '.$WHAT;
			//Is associative fields Arrays
			} else {
// 				$WHAT	= 'SET '.parseFields($options['what'], '`');
				$WHAT	= 'SET '.$this->formatFieldList($options['what']);
			}
			
		//Is a string
		} else {
			$WHAT	= $options['what'];
		}
		$TABLE		= static::escapeIdentifier($options['table']);
		
		$QUERY = "INSERT {$OPTIONS} {$TABLE} {$COLS} {$WHAT}";
		if( $options['output'] == static::SQLQUERY ) {
			return $QUERY;
		}
		return $this->query($QUERY, PDOEXEC);
	}
public function insert(array $options=array()) {
		$options += self::$insertDefaults;
		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' : (!empty($options['delayed'])) ? ' DELAYED' : '';
		$OPTIONS .= (!empty($options['ignore'])) ? ' IGNORE' : '';
		$OPTIONS .= (!empty($options['into'])) ? ' INTO' : '';
		
		$COLS = $WHAT = '';
		//Is an array
		if( is_array($options['what']) ) {
			//Is an indexed array of fields Arrays
			if( !empty($options['what'][0]) ) {
				// Quoted as escapeIdentifier()
				$COLS = '(`'.implode('`, `', array_keys($options['what'][0])).'`)';
				foreach($options['what'] as $row) {
					$WHAT .= (!empty($WHAT) ? ', ' : '').'('.implode(', ', $row).')';
				}
				$WHAT	= 'VALUES '.$WHAT;
			//Is associative fields Arrays
			} else {
// 				$WHAT	= 'SET '.parseFields($options['what'], '`');
				$WHAT	= 'SET '.$this->formatFieldList($options['what']);
			}
			
		//Is a string
		} else {
			$WHAT	= $options['what'];
		}
		$TABLE		= static::escapeIdentifier($options['table']);
		
		$QUERY = "INSERT {$OPTIONS} {$TABLE} {$COLS} {$WHAT}";
		if( $options['output'] == static::SQLQUERY ) {
			return $QUERY;
		}
		return $this->query($QUERY, PDOEXEC);
	}
public function insert ( array $ options = array ( ) ) { $ options += self :: $ insertDefaults ; 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' : ( ! empty ( $ options [ 'delayed' ] ) ) ? ' DELAYED' : '' ; $ OPTIONS .= ( ! empty ( $ options [ 'ignore' ] ) ) ? ' IGNORE' : '' ; $ OPTIONS .= ( ! empty ( $ options [ 'into' ] ) ) ? ' INTO' : '' ; $ COLS = $ WHAT = '' ; //Is an array if ( is_array ( $ options [ 'what' ] ) ) { //Is an indexed array of fields Arrays if ( ! empty ( $ options [ 'what' ] [ 0 ] ) ) { // Quoted as escapeIdentifier() $ COLS = '(`' . implode ( '`, `' , array_keys ( $ options [ 'what' ] [ 0 ] ) ) . '`)' ; foreach ( $ options [ 'what' ] as $ row ) { $ WHAT .= ( ! empty ( $ WHAT ) ? ', ' : '' ) . '(' . implode ( ', ' , $ row ) . ')' ; } $ WHAT = 'VALUES ' . $ WHAT ; //Is associative fields Arrays } else { // 				$WHAT	= 'SET '.parseFields($options['what'], '`'); $ WHAT = 'SET ' . $ this -> formatFieldList ( $ options [ 'what' ] ) ; } //Is a string } else { $ WHAT = $ options [ 'what' ] ; } $ TABLE = static :: escapeIdentifier ( $ options [ 'table' ] ) ; $ QUERY = "INSERT {$OPTIONS} {$TABLE} {$COLS} {$WHAT}" ; if ( $ options [ 'output' ] == static :: SQLQUERY ) { return $ QUERY ; } return $ this -> query ( $ QUERY , PDOEXEC ) ; }
Insert something in database

@param array $options The options used to build the query.
@return int The number of inserted rows.

It parses the query from an array to a INSERT query.
Accept only the String syntax for what option.
Insert something in database