the Mojolicious::Lite app is working with morbo but not working with hypnotoad.
my $dbh = DBI->connect("dbi:mysql:dbname=xxx", "uname", "pass",
{ AutoCommit => 0, mysql_enable_utf8 => 1}, )
or die "Couldn't connect to database: ", $DBI::errstr;
helper db => sub { $dbh };
get '/xxx' => sub {
my $sth = $self->db->prepare("insert into posts values(?,?,?,?,?,?)");
$sth->execute('xxx', 'xxx', 'xxx', 'xxx', 'xxx', 'xxx');
$sth->finish();
$self->db->commit;
};
when run with hypnotoad, rest of the app is working but it is not reading/writing data to/from database. please help me write code that work with hypnotoad