Got everything working.

Just need to do some renaming, check that it meets his requirements, and
check that it isn't vulnerable to SQL injections.