How to get formidable entry ID by post ID? [closed]

So, after a lot of searching (which is funny, because it’s such a basic function which should apear in the documents) i found that:

what you have to do to get the current post entry id is:

<?php $entry_id = $wpdb->get_var("SELECT id FROM $frmdb->entries WHERE post_id='". $post->ID ."'"); ?>