prefix . 'wppm_notifications'; $results = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $table WHERE user_id = %d AND is_read = 0 ORDER BY created_at DESC", $user_id ), ARRAY_A ); wp_send_json($results);