Get a row from a separate table by matching a posts meta_key to a tables ID column
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, … Read more