Tuesday, October 23, 2007

Book Review - The Web Wizard's Guide to PHP


I recently finished a programming book that I was quite happy with. This may actually be the first time I've ever been really happy with a technology book. I've been content with many a book before, but never really happy with one.

There are a few reasons why I liked this one so much

  1. It seems to be written for someone who already knows how to program and wants to add PHP to their knowledge base. Thus, it skips over the 5 page explanation of what a variable is, something that you find in many programming books because they all assume you've never programmed before.
  2. It's short. With less than 200 pages and a smaller page size than your average book, you could easily finish this book in a weekend if you had to learn PHP in a pinch.
  3. Full colour pages. Vain? Maybe. Trivial? Hardly. We are talking about a book on programming, there are bound to be some dry parts here people and those colour pages may just get you through that.
Now, I'd be a horrible critic if I didn't point out some bad parts of this book. The part I found the most frustrating about this book is the code descriptions. Each code example is followed by a bulleted description of the key lines in the example. The problem is that many descriptions are repeated over and over throughout the examples. There's a good chance that I can recognize the database connection string after the first twenty times I see it.

On the whole, however, I found this book an easy read that got down to business and showed the things I wanted it to. It didn't get into the crazy advanced functionality, but I don't think anyone would expect a book this size to do so.

Tuesday, October 9, 2007

MySQL Windows Install

I recently agreed to do some PHP/MySQL
development and since I don't have a proper test environment setup at home, I
thought it might be a good idea to make a quick walkthrough on how to set one
up. Today's post will focus on installing MySQL 5.0 on a Windows XP
machine. Please note: this is only intended for someone who doesn't have
any MySQL knowledge, but wants to start playing around with it.



Step 1: Get your software



Since MySQL is an open source project, there are numerous
places for you to download the software. The most popular is most likely
www.mysql.com which is run by a company called MySQL AB. You can download
a copy of the DBMS (Database Management Software) from this link:




http://dev.mysql.com/downloads/mysql/5.0.html





Download the copy of MySQL 5.0 for windows that comes with Setup.exe, this will
give you the easiest install.



Step 2: Begin the install



Using whatever unzipping software you have laying around (WinZip, WinRAR,
Ultimate Zip, etc.), unzip the download and double-click on setup.exe



Step 3: Next, Next, Next....





Click Next at the Welcome Screen and next again to select the typical
install and next once more to start the install. The typical install gives
you everything, but some developer tools such as C libraries and some example
scripts. You may have to click next through some advertisements for the
enterprise edition of MySQL, then take the option to configure your database.



Step 4: Configuration



I'm now going to recommend going the detailed route, this will ensure that
MySQL uses the least amount of memory on your machine which most likely has many
other apps on it. Make sure that Detailed Configuration is selected and
click Next. Select Developer Machine and click next again, click next
until you see a window with a checkbox that says Include bin directory in
Windows PATH
, check that box and click next. Enter a password you'll
remember into the two text boxes and click next, then execute.



Step 5: Okay, now what?



You can access the MySQL interface by either going to:



Start -> All Programs -> MySQL -> MySQL Server 5.0 -> MySQL Command Line Client, or
Go to your command line (Start -> Run and type in cmd and press enter) and type in mysql -h localhost -u root -p


Once you enter your password you should have a prompt like mysql>

You can create your first database by using the command create database database_name where database_name is any name you see fit for your first database. Now just type use database_name and starting writing SQL statements till you can't stand the excitement anymore.