By this code i am displaying a button by shortcode from user_id which are in database

PHOTO EMBED

Tue Oct 03 2023 11:13:35 GMT+0000 (Coordinated Universal Time)

Saved by @Alihaan #php

function edit_button_shortcode() {
    // Check if the user is logged in
    if (is_user_logged_in()) {
        global $wpdb;
        $user_id = get_current_user_id();

        // Check if the user's ID exists in the wp_fluentform_submissions table
        $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}fluentform_submissions WHERE user_id = %d", $user_id));

        // If the user's ID exists in the table, display the "Edit" button
        if ($results) {
            return '<a href="YOUR_EDIT_URL_HERE" class="edit-button">Edit</a>';
        }
    }
    return '';  // If the user is not logged in or their ID doesn't exist in the table, return an empty string
}
add_shortcode('edit_button', 'edit_button_shortcode');
content_copyCOPY

here the shortcode is [edit_button] and i want displaying this button for specific user whose ID number is in table by shortcode