TweetFollow Us on Twitter

Book Review: PHP and MySQL Web Development

Volume Number: 19 (2003)
Issue Number: 10
Column Tag: Programming

Book Review: PHP and MySQL Web Development

by Ron Davis

It used to be you were an HTML "programmer" if you understood what <B> was. I've never really thought there was any such thing as a HTML "programmer." HTML is a mark-up language. It's data, not instructions. I'm not going to get into my personal feelings on scripting verses programming, but I've done a bit of one and a lot of the latter. The day came when my personal website needed to be able to generate content on the fly and I went looking for a language to make it do so.

At first what I wanted was C/C++ but that really isn't what you want to do web work in. Remember you are mostly manipulating text, which C/C++ isn't really all that good at. Also you are generally working with a machine you can't compile on. You can upload files though, and those files can be executed, so you need a scripting language.

Perl is the language everyone associates with UNIX, but after attempting to remove my cerebellum through my eye sockets during early Perl sessions I went looking for another language to write in. That's when I found PHP. Here was a C like scripting language made to generate web pages - one that integrated with databases, for even more interesting possibilities.

There are a lot of good online tutorials on the web for PHP. It is a very popular language. This is partially because it is free and partially because it doesn't induce suicidal tendencies when you try to code in it.

While there is no real link between PHP and MySQL they always seem to go together. This is mainly because they are both free and offered as part of Linux, the dominant platform for web hosting companies. So everyone with a web site gets PHP and MySQL for free.

When it comes time to get serious about learning to use these two technologies, you should pick up the book PHP and MySQL Web Development by Luke Welling and Laura Thomson. It is both a great introduction and reference for PHP.

Personally I like books that teach you by doing. I want examples that will provide real world use. Even when a book does an example a chapter, I will often change the example to something I need as I read. PHP and MySQL Web Development does this well. After the required introductory chapter, each chapter introduces a new concept with a relevant example. In the end you have a complete web site with lots of different functionality.

To use the book you are going to have install PHP and MySQL. If you are using a non-server version of MacOS X you will have to install MySQL. There is downloadable package to do this with instructions at Marc Liyanage's site:

http://www.entropy.ch/software/macosx/mysql/

If you want to run PHP code on your local machine using the built in Apache server, you will need to do some configuration. Apple provides some instructions on how to do this.

http://developer.apple.com/internet/macosx/php.html

Once this is done you should have no trouble doing any of the examples in the book. I found no platform-specific problems while using the book.

The first part of the book teaches you the basics of PHP, including how you put PHP code inside your HTML file. It goes on to discuss the various features of the language includeing manipulating strings with regular expressions, reading and writing files, and arrays. After you get a basic understanding of PHP, it switches to talking about MySQL.

This first section on MySQL deals only with designing and creating databases. You work on the command line with MySQL.

After you have learned to use MySQL, you'll learn how to talk to MySQL with PHP. There are two chapters in the MySQL section showing basic and advanced interaction. In reality talking to other databases is accomplished almost exactly the same way. I had a site I built on my local machine using MySQL and then moved to a server and used it with MSSQL by changing the prefix on the calling routines.

Part three of the book is the meat of learning to use these technologies. The authors step you through a complete e-comerce system built with PHP and MySQL. By the time you get to this point in the book you understand the language and MySQL enough you can just start pulling the sections of this program you need out and use them. If you skip around you will occasionally have to go back to a previous chapter to figure out how the database is set up or what some variables mean. But if you need a user system, refer to chapter 24 "Building User Authorization and Personalization." Shopping cart? Chapter 25. Content management system? Chapter 27.

Appendix A on installing PHP and MySQL is largely useless to the Mac user. The index is good, letting you use the book as a general PHP/SQL reference. When you want more depth you can check out the PHP manual online at:

http://www.php.net/docs.php

Appendix B also gives an extensive list of web resources.

This book sits on my bookshelf with little post it notes sticking out at relevant pages. The only real complaint I have about the book is its size with over 800 pages. But it does cover a lot of stuff. Also since it is example based, it is somewhat hard to find a specific PHP function. I have little bookmarks for the date command and the SQL Alter table command.

If you are looking for a good book to cover all of the things about PHP and MySQL you need to do most common web tasks, this book is it.


Ron Davis is a long time Macintosh Software Engineer, having worked for companies like Apple and Metrowerks on a variety of products from development tools to anti-virus software. His day job is working for Alsoft, and his evening job is R.A.D. Productions, makers of Suck It Down and FinderEye.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links... | Read more »
Price of Glory unleashes its 1.4 Alpha u...
As much as we all probably dislike Maths as a subject, we do have to hand it to geometry for giving us the good old Hexgrid, home of some of the best strategy games. One such example, Price of Glory, has dropped its 1.4 Alpha update, stocked full... | Read more »
The SLC 2025 kicks off this month to cro...
Ever since the Solo Leveling: Arise Championship 2025 was announced, I have been looking forward to it. The promotional clip they released a month or two back showed crowds going absolutely nuts for the previous competitions, so imagine the... | Read more »
Dive into some early Magicpunk fun as Cr...
Excellent news for fans of steampunk and magic; the Precursor Test for Magicpunk MMORPG Crystal of Atlan opens today. This rather fancy way of saying beta test will remain open until March 5th and is available for PC - boo - and Android devices -... | Read more »
Prepare to get your mind melted as Evang...
If you are a fan of sci-fi shooters and incredibly weird, mind-bending anime series, then you are in for a treat, as Goddess of Victory: Nikke is gearing up for its second collaboration with Evangelion. We were also treated to an upcoming... | Read more »
Square Enix gives with one hand and slap...
We have something of a mixed bag coming over from Square Enix HQ today. Two of their mobile games are revelling in life with new events keeping them alive, whilst another has been thrown onto the ever-growing discard pile Square is building. I... | Read more »
Let the world burn as you have some fest...
It is time to leave the world burning once again as you take a much-needed break from that whole “hero” lark and enjoy some celebrations in Genshin Impact. Version 5.4, Moonlight Amidst Dreams, will see you in Inazuma to attend the Mikawa Flower... | Read more »
Full Moon Over the Abyssal Sea lands on...
Aether Gazer has announced its latest major update, and it is one of the loveliest event names I have ever heard. Full Moon Over the Abyssal Sea is an amazing name, and it comes loaded with two side stories, a new S-grade Modifier, and some fancy... | Read more »
Open your own eatery for all the forest...
Very important question; when you read the title Zoo Restaurant, do you also immediately think of running a restaurant in which you cook Zoo animals as the course? I will just assume yes. Anyway, come June 23rd we will all be able to start up our... | Read more »
Crystal of Atlan opens registration for...
Nuverse was prominently featured in the last month for all the wrong reasons with the USA TikTok debacle, but now it is putting all that behind it and preparing for the Crystal of Atlan beta test. Taking place between February 18th and March 5th,... | Read more »

Price Scanner via MacPrices.net

AT&T is offering a 65% discount on the ne...
AT&T is offering the new iPhone 16e for up to 65% off their monthly finance fee with 36-months of service. No trade-in is required. Discount is applied via monthly bill credits over the 36 month... Read more
Use this code to get a free iPhone 13 at Visi...
For a limited time, use code SWEETDEAL to get a free 128GB iPhone 13 Visible, Verizon’s low-cost wireless cell service, Visible. Deal is valid when you purchase the Visible+ annual plan. Free... Read more
M4 Mac minis on sale for $50-$80 off MSRP at...
B&H Photo has M4 Mac minis in stock and on sale right now for $50 to $80 off Apple’s MSRP, each including free 1-2 day shipping to most US addresses: – M4 Mac mini (16GB/256GB): $549, $50 off... Read more
Buy an iPhone 16 at Boost Mobile and get one...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering one year of free Unlimited service with the purchase of any iPhone 16. Purchase the iPhone at standard MSRP, and then choose... Read more
Get an iPhone 15 for only $299 at Boost Mobil...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering the 128GB iPhone 15 for $299.99 including service with their Unlimited Premium plan (50GB of premium data, $60/month), or $20... Read more
Unreal Mobile is offering $100 off any new iP...
Unreal Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering a $100 discount on any new iPhone with service. This includes new iPhone 16 models as well as iPhone 15, 14, 13, and SE... Read more
Apple drops prices on clearance iPhone 14 mod...
With today’s introduction of the new iPhone 16e, Apple has discontinued the iPhone 14, 14 Pro, and SE. In response, Apple has dropped prices on unlocked, Certified Refurbished, iPhone 14 models to a... Read more
B&H has 16-inch M4 Max MacBook Pros on sa...
B&H Photo is offering a $360-$410 discount on new 16-inch MacBook Pros with M4 Max CPUs right now. B&H offers free 1-2 day shipping to most US addresses: – 16″ M4 Max MacBook Pro (36GB/1TB/... Read more
Amazon is offering a $100 discount on the M4...
Amazon has the M4 Pro Mac mini discounted $100 off MSRP right now. Shipping is free. Their price is the lowest currently available for this popular mini: – Mac mini M4 Pro (24GB/512GB): $1299, $100... Read more
B&H continues to offer $150-$220 discount...
B&H Photo has 14-inch M4 MacBook Pros on sale for $150-$220 off MSRP. B&H offers free 1-2 day shipping to most US addresses: – 14″ M4 MacBook Pro (16GB/512GB): $1449, $150 off MSRP – 14″ M4... Read more

Jobs Board

All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.