Other rewrite of a 36 line script to work with mysqli/php 7

Hi, i have a very old 5 star rating script that is a core part of some of my sites systems, the problem is it's that old the code is all for mysql, so it could do with a rewrite to work with mysqli and php 7 as i wish to update my servers php to the latest version, but this script breaking is stopping me.