Thanks for sending. I figured out what's wrong.
I downloaded phpBB 3.0.4 which is the latest stable release and examined the database schema files via phpMyAdmin and compared with yours. They matched so your database is perfect, but nothing matched mine. Meaning....
The folks at phpBB have completely
re-designed the category system in this series, removing the old table. The other tables for topics, forums and posts are nearly identical - but not for categories. Your original script worked on my phpBB, for example. I suspect this change is very recent because the documentation angelwatt found clearly is outdated already, and so is my phpBB which isn't that old.
phpBB is entitled to improve their product, but at the same time hackers need to re-learn the new way of doing things too.
I looked at the new database format, and it's not obvious how categories are handled internally. I won't be upgrading so you need to approach one of the phpBB hack sites
like this one and ask anyone who is knowledgeable of the new format and willing to write you a new script that works specifically on 3.0.4 - be sure to mention the version as it matters!
If anyone else is following this, feel free to help if you have the latest installed and are familiar with database concepts.
-jim