Thanks guys, I fixed up all the bugs in my code, and it now works 100%. I learnt a lot figuring this out!
Here's an attachment of the finished product.
Remember:
When using, you'll have to manually place the database name, username, and password into the config.php file.
After that, checkout the install directory to setup the tables.