讨教 is polite and humble — you use it when YOU are the one asking the more knowledgeable person. The pattern is
向 X
讨教 ("to seek instruction from X"). Compare
请教, which is roughly synonymous and slightly more common in everyday speech;
讨教 sounds a touch more formal/literary.