「lastInsertId」(または PDO を使用していない場合は mysql_insert_id()) を使用するのは悪いことだとよく耳にします。トリガーの場合は、INSERT が作成した最後の ID ではないものを返す可能性があるため、明らかにそうです。
$DB->exec("INSERT INTO example (column1) VALUES ('test')");
// Usually returns your newly created ID.
// However when a TRIGGER inserts into another table with auto-increment:
// -> Returns newly created ID of trigger's INSERT
$id = $DB->lastInsertId();
代替手段は何ですか?