Trying to save the sort ranking to MySQL database