Migration Project

I recently went through a painful process of upgrading my website to use the newest version of PHP, version 7. Before I tell you about that, let me give you a little background on what PHP is and why I use PHP.

Have you ever heard of PHP? Have you at least heard of HTML? These are both programming languages that are used to build websites. HTML is more commonly known. These two languages can work together well to make a great system. HTML is a client side language and PHP is a server side language. That means when you go to a HTML web page, the file is retrieved by your web browser (Internet Explorer, Mozilla Firefox, Google Chrome, Safari, Opera, etc.) and all of its contents are displayed to you. When you go to a PHP web page, the server that is hosting the file, like Facebook for example, interprets the file. Then the results are sent as HTML to your browser. PHP is great at communicating with a database and sending output to you. This allows the private database communication and credentials to stay on the server and only results be sent to your web browser as HTML.

When I was in college, I was in a project management class. My group was assigned a project of a organization out in the community. If I remember correctly, the organization wanted a way to track donations. Most people would think to use Microsoft Excel to track things like that. Well two problems with that, you can only access the Excel spreadsheet on one computer and only one person can access it at a time. So most of the other groups in the class, that had similar projects, decided to use Microsoft Access. Which is basically Excel on steroids. It turns the spreadsheet concept of Excel into a database management system, while still being pretty user friendly. It allows multiple people to access the database on multiple computers at the same time. That was not good enough for me. So the next step up was using a true database product and some way to communicate with it. Some example of database products are: Oracle, Microsoft SQL, and MySQL. The only one that is free is MySQL paired with PHP. I already had my own website at the time and the hosting company allows you to have MySQL databases. So I started building a tracking system for them using PHP and MySQL. The great thing about this is that it can be accessed anywhere, even outside of that organization’s office like in the field. They loved the system when we presented it to them! I am always curious if it ever got put into use. I decided I had uses of my own for a system like that.

Have you ever tried to look up a transaction in your checking account or credit card from months ago on the bank website? You really can’t unless you know which statement to go look at and that is if they haven’t “archived” your old statements. So I decided to create a tracking system for my finances using the same concept as the college project. It may seem like double work, but I enter all of my checking and credit card transactions into my own little tracking system. I am able to categorize everything for research later on down the road and it makes me be accountable for everything I spend. For example, I can go look at how much I spent on Groceries or Dining Out or Gas.

I have been using my finance tracking system for about eight years now. I recently ran into an issue with my PHP version and my hosting environment. I use GoDaddy for website hosting and I found it was cheaper to purchase three years of hosting in a new product than to renew my old hosting product for one year. I built the original systems using PHP version 5. When I setup the new hosting environment, it recommended PHP version 7. In recent versions of PHP, they have deprecated (removed support for) certain commands that I used to communicate with the MySQL database. So I either had to run my website using an old version of PHP that is not getting security updates or update my PHP programming to use the new and more secure commands to communicate with the database.

Over the years, I started tracking my credit cards along with my checking account. So I would have to copy all the files from one folder to another and then go in and update a couple commands on all of the 20 or so files. When I decided to update my PHP commands to meet PHP 7 standards, I didn’t want to do it 5 times, once for each account’s folder. I redesigned it to where I only have one folder with the true PHP files and the other account’s folders just reference the commands in the other. It took a while to update all the PHP files to use the proper commands. I did it on my laptop so that I wouldn’t have to keep downloading and uploading changes to my website until I got it right. The files all have an “account” variable. So each folder just needs one unique file that tells the files which account to query. It will be great going forward. Adding new accounts will be easy and adding features will apply to all account sites at once!

I learned a lot from my college project and personal finance project. I was able to build upon it when I got into my career in IT. Database work is one of my favorite parts of my career. It is very fulfilling to figure out just the right way to get the data someone wants out of a database.

Posted in IT

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s