php - Insert doesn't work on SQL Server but no error -


i'm working on someone's else database creating simple php solution, running apache (xampp+windows 2003 server) connects ms sql server database running windows 2008 r2.

i've been working few days, i've created few tables, i've inserted data on tables, i'm trying insert data existing table using php, table in particular insert statement doesn't work @ all, there no error message.

here code.

    <?php      include '../../includes/mssql.php';      $insereitem = "insert tbl_notas_faturamento_itens (cd_lancamento   ......... ) values (26452,.....0)";  $stmt = sqlsrv_query( $conn, $insereitem); if( $stmt === false ) {      die( print_r( sqlsrv_errors(), true)); }  echo $insereitem . "\n";  ?> 

there no error message.

as can see i've removed data insert statement doesn't use space here (there 88 values inserted). there no error message, there no error in apache logs, there no error in php logs data not commited.

as can see did "echo" statement, if copy , paste statement in sql server management studio insert works should, if try commiting php won't work.

the table i'm trying insert data has insert trigger , i'm pretty sure problem because if disable trigger insert works should (so there no error in building insert command).

i've tried use other sqlsrv_ commands, using begin connection, prepare, execute , commit, , result same. sqlsrv_execute returns true, sqlsrv_prepare returns

ps: real code isn't 1 above, since real code uses array parse parameters, final insert statement same, , problem happens either way.

here's code insert trigger: (as said before, database not built me)

set ansi_nulls on set quoted_identifier on go  alter  trigger [trg_tbl_notas_faturamento_itens_reginserir] on [dbo].[tbl_notas_faturamento_itens]  insert      if exists (select 'true' inserted)         begin  --set nocount on --if @@rowcount=0 return              declare @cd_lancamento      int             declare @cd_filial          int             declare @cd_item            int             declare @cd_cme             int             declare @cd_material        int             declare @cd_empresa         int             declare @cd_id              int             declare @dt_emissao         datetime              select @cd_lancamento =     (select cd_lancamento   inserted)             select @cd_empresa =        (select cd_empresa      dbo.tbl_notas_faturamento   (cd_lancamento = @cd_lancamento))             select @cd_filial =         (select cd_filial       dbo.tbl_notas_faturamento   (cd_lancamento = @cd_lancamento))             select @cd_item =           (select cd_item         inserted)             select @cd_cme =            (select cd_cme          inserted)             select @cd_material =       (select cd_material     inserted)             select @cd_id =             (select cd_id           inserted)             select @dt_emissao =        (select dt_emissao      dbo.tbl_notas_faturamento   (cd_lancamento = @cd_lancamento))              --calcula impostos             exec sp_calcula_impostos_notas_faturamento @cd_lancamento, @cd_item, @cd_cme, @cd_material              --total lancamento             exec sp_total_notas_faturamento @cd_lancamento              --atualiza volumes             exec sp_calcula_volumes_notas_faturamento @cd_lancamento, @cd_empresa              --atualiza kardex             exec sp_calcula_estoque 41, @cd_lancamento, @cd_id, @dt_emissao, @cd_filial, @cd_material          end 


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -