src/System/Crayner/Database/DB.php
protected static function makeMultipleInsert($table, $data)
    {
        $insert_values = array();

        foreach ($data as $d) {
            $insert_values = array_merge($insert_values, array_values($d));

            $count = count($d);
            $array = array_fill(0, $count, '?');

            $placeholder[] = '('.implode(',', $array).')';
        }

        $column = implode(',', array_keys($data[0]));
        $values = implode(',', $placeholder);

        $query  = "INSERT INTO {$table} ({$column}) VALUES {$values}";

        return [$query, $insert_values];
    }
protected static function makeMultipleInsert($table, $data)
    {
        $insert_values = array();

        foreach ($data as $d) {
            $insert_values = array_merge($insert_values, array_values($d));

            $count = count($d);
            $array = array_fill(0, $count, '?');

            $placeholder[] = '('.implode(',', $array).')';
        }

        $column = implode(',', array_keys($data[0]));
        $values = implode(',', $placeholder);

        $query  = "INSERT INTO {$table} ({$column}) VALUES {$values}";

        return [$query, $insert_values];
    }
protected static function makeMultipleInsert ( $ table , $ data ) { $ insert_values = array ( ) ; foreach ( $ data as $ d ) { $ insert_values = array_merge ( $ insert_values , array_values ( $ d ) ) ; $ count = count ( $ d ) ; $ array = array_fill ( 0 , $ count , '?' ) ; $ placeholder [ ] = '(' . implode ( ',' , $ array ) . ')' ; } $ column = implode ( ',' , array_keys ( $ data [ 0 ] ) ) ; $ values = implode ( ',' , $ placeholder ) ; $ query = "INSERT INTO {$table} ({$column}) VALUES {$values}" ; return [ $ query , $ insert_values ] ; }
Make Multiple Insert Parameter

@param  string $table
@param  array  $data
@return array
Make Multiple Insert Parameter