in reply to DBI with MySQL InnoDB tables troubles

Thanks it could have helped... but for me 'DESTROY' does only mean it does not work... and not why :(
-> prepare for DBD::mysql::db (DBI::db=HASH(0xae4410)~0xaf6400 ' INSERT INTO log (`timestamp`,`alert`,`id_daemon`,`id_e +vent_type`) VALUES (NOW(),'y','31','3'); ') thr#505010 dbd_st_prepare calling count_params (counting params emulation) <- prepare= DBI::st=HASH(0xb04b00) at sermon line 809 -> DESTROY for DBD::mysql::st (DBI::st=HASH(0xaeae60)~INNER) thr#5 +05010 <- DESTROY= undef at sermon line 810 -> execute for DBD::mysql::st (DBI::st=HASH(0xb04b00)~0xaeadd0) th +r#505010 -> dbd_st_execute for 00ae9a20

Replies are listed 'Best First'.
Re^2: DBI with MySQL InnoDB tables troubles
by Tobin Cataldo (Monk) on Jul 26, 2007 at 13:47 UTC
    Sometimes when working with InnoDB, I need to quote strings and NOT quote integers when preparing an INSERT. And also you might try
    prepare() or die();
    on your prepare statement. Also, are those backticks in your prepare statement? Try simple quotes.
Re^2: DBI with MySQL InnoDB tables troubles
by ysth (Canon) on Jul 26, 2007 at 18:36 UTC
    That doesn't look right: some statement handle is being destroyed after prepare returns and before execute is called. Could you show us the actual code you ran to get that trace?

    For comparison, when I do this:

    my $dbh = ...; $req = "INSERT INTO log (`timestamp`,`alert`,`id_daemon`,`id_event_type`) VALUES (NOW(),'y','31','3')"; DBI->trace(4); $query = $dbh->prepare($req); $query->execute(); DBI->trace(0);
    I get this trace:
    DBI 1.53-ithread default trace level set to 0x0/4 (pid 716) -> prepare for DBD::mysql::db (DBI::db=HASH(0x7804d0)~0x8fc970 'IN +SERT INTO log (`timestamp`,`alert`,`id_daemon`,`id_event_type`) VALUES (NOW(),'y','31','3')') thr#603010 New DBI::st (for DBD::mysql::st, parent=DBI::db=HASH(0x8fc970), id +=) dbih_setup_handle(DBI::st=HASH(0x8fcbf0)=>DBI::st=HASH(0x60a480), +DBD::mysql::st, 8fcc00, Null!) dbih_make_com(DBI::db=HASH(0x8fc970), 8fd720, DBD::mysql::st, 440, + 0) thr#603010 dbd_st_prepare calling count_params (counting params emulation) <- prepare= DBI::st=HASH(0x8fcbf0) at - line 7 -> execute for DBD::mysql::st (DBI::st=HASH(0x8fcbf0)~0x60a480) th +r#603010 -> dbd_st_execute for 008fcd00 ---> parse_params with statement INSERT INTO log (`timestamp`,`alert`,`id_daemon`,`id_event_type`) VALUES (NOW(),'y','31','3') num params 0 mysql_st_internal_execute <- dbd_st_execute returning imp_sth->row_num 1 <- execute= 1 at - line 8
Re^2: DBI with MySQL InnoDB tables troubles
by Ouato (Novice) on Jul 26, 2007 at 15:47 UTC
    Thank you but it didn't do the trick...
    INSERT INTO log (timestamp,alert,id_daemon,id_event_type) VALUES (NOW(),'n',31,3);
    does not do anything.
    prepare or die() never go through die()... as execute.
      What is the sayAll() subroutine you are calling? Can't you use die() or warn() until you figure out the issue?