PHP script to add WordPress admin user

I recently needed to add a new administrator username to a Wordpress install.

Doing this manually via SQL is not the most difficult task in the world, but it can be quite a challenge as it requires special access (either to mysqladmin or something like phpMyAdmin) and SQL knowledge.

Plus there’s a always room for error when messing around with SQL data.