Michael Ramsey – The Website! This is a Tagline?

1Aug/110

Learning PHP – Part 3: Variables

Gen. Jose Hernandez (from The Commons)

Well, somehow I managed to let more than a month slip by without getting this post up. Between being quite busy for a lot of the time, and a bit of procrastination it was easy to fall behind. I've been making progress off and on through PHP and MySQL for Dynamic Web Sites, but with the extremely hot weather in Toronto lately, it has been difficult to get any reading done on the subway sometimes.

Scalar Variables

Variables are the subject of this long delayed post. Variables are used in PHP in much the same way that they are in virtually any other major scripting or programming language. Variables use in PHP is fairly informal. A variable's name must start with a dollar sign and be followed with a letter or underscore (e.g. $variable); beyond that it can be called more or less whatever you want. Unlike in some other languages, variables can be created on the fly, and don't have to be declared or initialized beforehand.

8Jun/110

Learning PHP – Part 2: The Basics

A papier-mache cow on Mrs Mellor’s car, 1944 (from The Commons)

Jumping into PHP hasn't been too hard for me. The book is aimed at people with a bit of programming/scripting experience, or at least a familiarity with the concepts. That worked just fine for me, since I have previously worked with VB a bunch when I was a teenager, and have had to hack bits of code here and there in the intervening years. So, the basics are more about learning the syntax and what sort of things you can and can't do.

6Jun/113

Learning PHP – Part 1: Getting Started

Egypt: Arabic Window and Native Bazaar, Cair

An Egyptian Bazaar (from The Commons)

Having finished off my HTML and CSS review and learning, I had a hard time deciding where to go next. Having already learned some JavaScript previously, I poked around in the W3schools tutorials for it, but ended up deciding to tackle PHP and MySQL.

Part of the reason I decided on PHP and MySQL is because I've had a book on the two technologies sitting around for some time. So I've been working my way through PHP and MySQL for Dynamic Web Sites (2nd Edition) by Larry Ullman. So far, in my humble opinion, it's an excellent book. I'm finding it is getting through the material at a good pace. The progression is quite logical from one chapter to the next, and the examples are quite relevant and useful. Since the book has been sitting around for awhile, it covers PHP 5 (which is now at version 5.3.6 a.k.a. PHP 6) and MySQL 4.1 (now at version 5.5). Obviously this makes it a bit out of date, but as far as I understand, the versions that I'm looking at are both still widely used, and the newer versions aren't a whole lot different.

Before jumping into the actual work I've done in learning PHP and MySQL, I figure I should give a bit of an introduction to what exactly PHP and MySQL are and what you do with them. The book also does this, which wasn't exactly that useful for me since I've got a fairly good undstanding of many web technologies, even if I don't know the details of how to actually use them.