A new “personalised” online tool that predicts the most effective medication for individual patients with type 2 diabetes could benefit millions of people with the condition, researchers have suggested.