function insert( $table, $rows, $method = null ) {

        if ( empty( $rows ) ) return;
        if ( !isset( $rows[ 0 ] ) ) $rows = array( $rows );

        if ( $method === 'prepared' ) {

            return $this->insertPrepared( $table, $rows );

        } else if ( $method === 'batch' ) {

            return $this->insertBatch( $table, $rows );

        } else {

            return $this->insertDefault( $table, $rows );

        }

    }
function insert( $table, $rows, $method = null ) {

        if ( empty( $rows ) ) return;
        if ( !isset( $rows[ 0 ] ) ) $rows = array( $rows );

        if ( $method === 'prepared' ) {

            return $this->insertPrepared( $table, $rows );

        } else if ( $method === 'batch' ) {

            return $this->insertBatch( $table, $rows );

        } else {

            return $this->insertDefault( $table, $rows );

        }

    }
function insert ( $ table , $ rows , $ method = null ) { if ( empty ( $ rows ) ) return ; if ( ! isset ( $ rows [ 0 ] ) ) $ rows = array ( $ rows ) ; if ( $ method === 'prepared' ) { return $ this -> insertPrepared ( $ table , $ rows ) ; } else if ( $ method === 'batch' ) { return $ this -> insertBatch ( $ table , $ rows ) ; } else { return $ this -> insertDefault ( $ table , $ rows ) ; } }
Insert one ore more rows into a table

The $method parameter selects one of the following insert methods:

"prepared": Prepare a query and execute it once per row using bound params
Does not support Literals in row data (PDO limitation)

"batch":    Create a single query mit multiple value lists
Supports Literals, but not supported everywhere

default:    Execute one INSERT per row
Supports Literals, supported everywhere, slow for many rows

@param string $table
@param array $rows
@param string|null $method
@return \PDOStatement|null
Insert one ore more rows into a table