Ouato has asked for the wisdom of the Perl Monks concerning the following question:
___________________________________CREATE TABLE `log` ( `id` int(11) NOT NULL auto_increment, `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', `alert` enum('y','n') NOT NULL default 'y', `id_daemon` int(11) NOT NULL default '0', `id_event_type` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `id_daemon` (`id_daemon`), KEY `id_event_type` (`id_event_type`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;
___________________________________ALTER TABLE `log` ADD CONSTRAINT `log_ibfk_1` FOREIGN KEY (`id_daemon`) REFERENCES `daemons` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `log_ibfk_2` FOREIGN KEY (`id_event_type`) REFERENCES `event_types` (`id`) ON DELETE CASCADE;
When I paste the Insert request into 'mysql' in command line, or by phpMyAdmin... it works... but not with DBI.$req = "INSERT INTO log (`timestamp`,`alert`,`id_daemon`,`id_event_type`) VALUES (NOW(),'y','31','3')"; $query = $dbh->prepare($req); $query->execute or sayAll("Query failed : $req".$query->errstr);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI with MySQL InnoDB tables troubles
by erix (Prior) on Jul 26, 2007 at 18:41 UTC | |
|
Re: DBI with MySQL InnoDB tables troubles
by TOD (Friar) on Jul 26, 2007 at 12:46 UTC | |
|
Re: DBI with MySQL InnoDB tables troubles
by Ouato (Novice) on Jul 26, 2007 at 13:12 UTC | |
by Tobin Cataldo (Monk) on Jul 26, 2007 at 13:47 UTC | |
by ysth (Canon) on Jul 26, 2007 at 18:36 UTC | |
by Ouato (Novice) on Jul 26, 2007 at 15:47 UTC | |
by Tobin Cataldo (Monk) on Jul 26, 2007 at 16:53 UTC | |
|
Re: DBI with MySQL InnoDB tables troubles
by Ouato (Novice) on Jul 27, 2007 at 07:49 UTC | |
by andreas1234567 (Vicar) on Jul 27, 2007 at 14:06 UTC |