예제 #1
0
 private static function get_data_row_insert($node_schema, $node_table, $data_row_columns, $data_row)
 {
     $columns = array();
     $values = array();
     $data_row_columns_count = count($data_row_columns);
     for ($i = 0; $i < $data_row_columns_count; $i++) {
         $columns[] = mysql5::get_quoted_column_name($data_row_columns[$i]);
         $values[] = mysql5::column_value_default($node_schema, $node_table, $data_row_columns[$i], $data_row->col[$i]);
     }
     $columns = implode(', ', $columns);
     $values = implode(', ', $values);
     return sprintf("INSERT INTO %s (%s) VALUES (%s);\n", mysql5::get_fully_qualified_table_name($node_schema['name'], $node_table['name']), $columns, $values);
 }