protected function insertPrepared( $table, $rows ) {

        $columns = $this->getColumns( $rows );
        if ( empty( $columns ) ) return;

        $query = $this->insertHead( $table, $columns );
        $query .= "( ?" . str_repeat( ", ?", count( $columns ) - 1 ) . " )";

        $statement = $this->prepare( $query );

        foreach ( $rows as $row ) {

            $values = array();

            foreach ( $columns as $column ) {

                $value = (string) $this->format( @$row[ $column ] );
                $values[] = $value;

            }

            $this->onQuery( $query, $values );

            $statement->execute( $values );

        }

        return $statement;

    }
protected function insertPrepared( $table, $rows ) {

        $columns = $this->getColumns( $rows );
        if ( empty( $columns ) ) return;

        $query = $this->insertHead( $table, $columns );
        $query .= "( ?" . str_repeat( ", ?", count( $columns ) - 1 ) . " )";

        $statement = $this->prepare( $query );

        foreach ( $rows as $row ) {

            $values = array();

            foreach ( $columns as $column ) {

                $value = (string) $this->format( @$row[ $column ] );
                $values[] = $value;

            }

            $this->onQuery( $query, $values );

            $statement->execute( $values );

        }

        return $statement;

    }
protected function insertPrepared ( $ table , $ rows ) { $ columns = $ this -> getColumns ( $ rows ) ; if ( empty ( $ columns ) ) return ; $ query = $ this -> insertHead ( $ table , $ columns ) ; $ query .= "( ?" . str_repeat ( ", ?" , count ( $ columns ) - 1 ) . " )" ; $ statement = $ this -> prepare ( $ query ) ; foreach ( $ rows as $ row ) { $ values = array ( ) ; foreach ( $ columns as $ column ) { $ value = ( string ) $ this -> format ( @ $ row [ $ column ] ) ; $ values [ ] = $ value ; } $ this -> onQuery ( $ query , $ values ) ; $ statement -> execute ( $ values ) ; } return $ statement ; }
Insert rows using a prepared query

@param string $table
@param array $rows
@return \PDOStatement|null
Insert rows using a prepared query