diff --git a/core/file_api.php b/core/file_api.php index fef6404..4d816fd 100644 --- a/core/file_api.php +++ b/core/file_api.php @@ -795,7 +795,7 @@ function file_add( $p_bug_id, array $p_file, $p_table = 'bug', $p_title = '', $p 'user_id' => (int)$p_user_id, ); # Oracle has to update BLOBs separately - if( !db_is_oracle() ) { + if( !db_is_oracle() && !db_is_mssql() ) { $t_param['content'] = $c_content; } $t_query_param = db_param(); @@ -803,10 +803,18 @@ function file_add( $p_bug_id, array $p_file, $p_table = 'bug', $p_title = '', $p $t_query_param .= ', ' . db_param(); } - $t_query = 'INSERT INTO ' . $t_file_table . ' - ( ' . implode(', ', array_keys( $t_param ) ) . ' ) - VALUES - ( ' . $t_query_param . ' )'; + if ( !db_is_mssql() ) { + $t_query = 'INSERT INTO ' . $t_file_table . ' + ( ' . implode(', ', array_keys( $t_param ) ) . ' ) + VALUES + ( ' . $t_query_param . ' )'; + } else { + $t_query = 'INSERT INTO ' . $t_file_table . ' + ( ' . implode(', ', array_keys( $t_param ) ) . ', content ) + VALUES + ( ' . $t_query_param . ', ' . $c_content . ' )'; + } + db_query( $t_query, array_values( $t_param ) ); if( db_is_oracle() ) {