MTのデータベースで任意のSQLを実行して結果を取得する

MT::Object->driver()を使う。 my $sql = "SELECT * FROM mt_entry WHERE entry_id = ?"; my @bind_values = ( 100 ); require MT::Object; my $driver = MT::Object->driver; my $dbh = $driver->rw_handle; my $sth = $dbh->prepare( $sql ); die $dbh->errstr if $dbh->errstr; $sth->execute( @bind_values ); die $st…