TYPE isn't valid on an table option for create. It was available in the past, but was deprecated in favour of the ENGINE keyword in 4.x versions. It was removed in 5.x from the looks of it.
Quick glance looks okay, but I can't be sure if it'll work. Rename the TYPE options to ENGINE and try again.
A better option though would be to dump the software you have, and look for something newer. If it was written for Mysql < 5, than chances are the PHP code is high version 3x or low version 4.x. Despite backwards compatibility attempts, there is actually a lot that won't work properly without some minor modifications between the 4.x and 5.x versions of PHP. That assumes PHP of course.
header('HTTP/1.1 420 Enhance Your Calm');