Leave a Reply

1 comment

  1. global $wpdb;
    
    /* grab meta value, it is assumed you know the post id ($id) in question */
    $dot_number = get_post_meta( $id, 'dot_number', true );
    
    /* grab all rows with matching value in 'dot_number' column */
    $matches_query = $wpdb->get_results(
        "SELECT * FROM " . $wpdb->prefix . "csadata " .
        "WHERE dot_number = " . $dot_number, ARRAY_A
    );
    
    // do something with query result, usually iterate over it and display something