This entry was originally published on my personal blog engine. It has since been moved into Facebook. This entry talks about the old version of my web page, which used a LAMP stack instead of MEAN.
I could have used WordPress (or Blogger, or one of a dozen other sites on the web) to get a free blog. Instead, I spent several hours with PHP and MySQL and wrote my own engine from scratch, using Aptana Studio. You’re looking at it right now.
This isn’t a fancy engine. It’s pretty much limited to entries, comments, and my responses to comments. It needs upgrades right now, the most glaring omission is the use of keywords to organize entries. In terms of visual effects, it has little to none.
I have my reasons, and the most prominent is simply pride. I haven’t coded with the PHP/MySQL mix since my university-internship days. I needed to upgrade my skills. All my books give tutorials on how to create forum pages or e-commerce sites. Compared to those, a blog engine is simple. As an added bonus, I have complete control if I don’t like a comment, it gets deleted from the database.
I may regret programming my own blog engine. I read somewhere that writing your own blog engine is simple to do, a good way to learn programming skills, but a pain to perfect. That’s fine. This code is a means to an end, and that end is posting blog entries. I put in some rather simple but brutal insurance against, as that article mentioned, an avalanche of spam comments. Not that I don’t see those every time I read Yahoo! News articles.
I think the programming skills I gained will outweigh the negatives. I first started web programming with HTML (and using a book called HTML Programming for Dummies, or something to that effect) back in the 1990s, before I even began my studies. It’s time to upgrade to HTML5. Ditto for PHP/MySQL barely two years passed since my last program, and they depreciated all those MYSQL commands to MYSQLI. Last but not least is CSS. I used it on a limited basis before; now I’m becoming an expert. You can’t spend your entire life hiding behind Dreamweaver; eventually you need to confront the code itself.
For example, I learned these little tidbits, all of which cost me hours in debugging time:
- MySQL doesn’t support the MERGE statement. From using SQL Server, I got rather used to that command. Here, I’m stuck using an INSERT command with an ON DUPLICATE KEY clause tacked onto it.
- Cannot modify header information – headers already sent. If you’ve ever used PHP/MySQL, you have seen this error message a lot, no matter how good you are. I wasn’t annoyed by triggering it initially. I was annoyed when it started showing up on a remote server, despite the code running fine on my local server.
- The MYSQLI upgrades include parameters as well as function names. When I started working on this, I actually thought I could recycle some old code from 2011/12 and just replace “mysql” with “mysqli.” No, you need to add a connection parameter as well. It makes perfect sense, and was a great PHP upgrade. It also kept me from reusing all my old code
If you want to screw with this blog engine, please go ahead it will probably prove to be a learning experience for me. If you want more features for comments like, say, allowing tags through don’t bother asking. I’m a lot more worried about someone breaking my site than in pleasing anonymous posters.