The referenced lines in do_rating function should read 614-649, not 514-549. Easy Fix on 4 mysql_query hits,thanks quote_smart.