Just add it in where you’re doing your custom query called by prepare items:
public static function get_members( $per_page = 5, $page_number = 1 ) {
global $wpdb;
$sql="SELECT * FROM my_members";
if ( ! empty( $_REQUEST['orderby'] ) ) {
$sql .= ' ORDER BY ' . esc_sql( $_REQUEST['orderby'] );
$sql .= ! empty( $_REQUEST['order'] ) ? ' ' . esc_sql( $_REQUEST['order'] ) : ' ASC';
}
$sql .= " LIMIT $per_page";
$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
if( ! empty( $_REQUEST['s'] ) ){
$search = esc_sql( $_REQUEST['s'] );
$sql .= " WHERE card LIKE '%{$search}%'";
}
$result = $wpdb->get_results( $sql, 'ARRAY_A' );
return $result;
}
I haven’t tested this, but that should be what you’re looking for. You should also look at using $wpdb
and included functions like $wpdb->prepare
to formulate your SQL queries using WordPress built in handling, escaping, etc
https://developer.wordpress.org/reference/classes/wpdb/prepare/
UPDATE:
You also need to update anywhere you make custom database queries to handle including the WHERE statement, including counts, etc.
I recommend that you review this example, and rewrite your entire list table class based on this tutorial, which uses a custom database table data, and has the search handling integrated as well:
https://webkul.com/blog/create-admin-tables-using-wp_list_table-class/