Thailand 's parliament has elected Prime Minister Thaksin Shinawatra to a second four-year term .