Amazon.com Customer Reviews
stuck at chapter 7 - Review written on July 02, 2006
Rating: 2 out of 5
2 customers found this review helpful, 10 did not.
I bought an O'Reilly book to teach myself perl & it was great. I'm writing a review about this one because I'm frustrated. The first six chapters go by like a breeze for folks familiar with other programming languages (I use perl, mel, c, html, studio). well, that's not entirely true. I couldn't get my apache server to execute any of my php code (I'm on a new mac mini). I followed all the instructions in appendix A to no avail. Finally, I just uploaded my php scripts to a webserver & my code worked there. but that's super annoying because I have to upload my php file every time I want to test it (& sometimes my internet connection is slow). whatever. anyway: when I got to chapter 7 none of the examples worked anymore & it is extremely vague exactly how you're supposed to run some commands. for example: if you want to set up a database, you run the following command only one time:
CREATE TABLE dishes (
dish_id INT,
dish_name VARCHAR(255),
price DECIMAL(4,2),
is_spicy INT
)
but where do you run it from? also, the book relies heavily on using extensions that weren't installed in my version of php. additionally, I'm not sure if certain examples are just there to demonstrate what should work, or things that actually work. ie: this code is supposed to connect you to a database:
require 'DB.php';
$db = DB::connect('mysql://penguin:top^hat@db.example.com/restaurant');
is that actually supposed to work, or is it just an example? if it doesn't work for me (which it didn't), then I have to figure out what's wrong w/my system etc.
another frustrating this is the book recommends using several commands (like running system commands) that my webserver doesn't allow for security reasons. this problem should at least be addressed in the book. hopefully, I'm not just frustrated with php itself because several of my coworkers swear by it. but I've had more luck tracking down answers to very basic questions online than finding them in this book.
It's not good when a book for beginners has bugs in the code. - Review written on March 16, 2006
Rating: 1 out of 5
11 customers found this review helpful, 4 did not.
I'm sorry, but this book is just down right lousy. It was the very first book I ever picked up to teach me PHP. Back then, I had assumed that all books on technical matters would be as close to perfect as one could get. However, as I typed away at my initial pages, nothing was working right. There was constant errors. As a beginner, this is quite frustrating, because you just have no idea as to what you could be doing wrong. Well...as I looked online in the errata section for the book, there was so much information as to the corrections to the code, that I might as well have gone to the Errata section for free rather than waste my time and money. Now, with more experience, the bugs are so bluntly obvious as to what was wrong. Not like a typo, or a group of text missing. But I mean, obvious very "simplistic" code that was...just the wrong code. And this isn't very professional to have code that obvious be printed. It shows that it wasn't tested.
What's more: PHP5 is a huge evolution to the previous incarnations. While there's some basic coverage of things such as XML parsing, there's nothing about classes, or anything that makes PHP5 different. So, for the traditional procedural style of coding, there's far better books out there on the topic of PHP4, and there's far more valuable resources to get you up to speed in php5 that give you actual projects.
Good intro, but lacking in important areas - Review written on July 01, 2005
Rating: 2 out of 5
23 customers found this review helpful, 6 did not.
There are several problems with this book that the author should fix for a future edition:
1. He structures the pages in the examples and exercises such that they mix decision code with user interface code. That these two are not separated is a serious flaw; doing server side validation is different for pages where the different types of code are separated, and it is best to keep them separated when different people are working on each type of code.
2. The part of the code (in code samples from chapter 6 onwards) that check for the presence of the $_POST[`_submit_check'] generates an error if you have apache set to show errors. The fix for this is to place the following code before the "if($_POST[`_submit_check']"):
if (array_key_exists('_submit_check', $_POST)) {
// print "$_POST[_submit_check];
} else {
$_POST['_submit_check']=false;
}
(the commented-out portion was for troubleshooting)
3. In chapter 2, he goes about formatting output using printf(), \n, and placeholders to place leading whitespace in front of numbers to line them up in a column. However, HTML ignores excessive whitespace, unless such whitespace is enclosed in
< pre> tags, which if used leads to some other problems. The result is that formatting and extra line breaks to not appear in the browser when testing the code. \n should be replaced by < br/ >, and a < table > should be used (with the align attributes of the elements set) to format output.
4. He only touched on the "5" part of php 5, and for the most part this is restricted to the part of the book dealing with databases. The author would do well to go into creating classes.
5. It would be nice if the author could instruct the reader on how to store user-defined functions in a file that could be used in other programs via the "require" directive. This would be handy for the exercises in the book since some of the code validation and other scripts need to be reused.
The pros are that interaction with databases is done well, the lessons are clear and easy to understand. It is a good intro book, but barely warrants the "5" in the title. For better server side validation (i.e. with decision and presentation code separated) look elsewhere.
Good place to start, but beware: no OOP coverage - Review written on January 06, 2005
Rating: 3 out of 5
13 customers found this review helpful, 1 did not.
I picked up this book shortly after PHP 5 became available, expecting that because it's specifically about PHP 5 it would give some attention to PHP 5's new features over PHP 4. Most specifically I wanted to read about PHP 5's completely new Object Model, which is not a minor change. This book only mentions objects and classes in passing though, so it wasn't helpful to me at all in that regard. The chapter on working with databases has been helpful to me. It focuses mainly on PEAR DB but includes some good information about PHP 5's improved MySQL functions.
It's still a helpful book for programming PHP in general, and I do check it from time to time to brush up on syntax or look at example code. It reads pretty well and the examples are solid. If you're coming to PHP with prior experience in Java, Perl, or anything similar, you'll probably find the pace pretty slow. If you want a well-rounded introduction to PHP you'll do well with this book. If you're looking for information on more advanced topics like object-oriented programming, look elsewhere.
Magnificent How-To Guide to Real World PHP - Review written on October 24, 2004
Rating: 5 out of 5
10 customers found this review helpful, 4 did not.
This book is fabulous! I've been programming PHP for some time now, though I've never tackled a large project. And I wasn't really sure how to do it, frankly, until stumbling across Mr. Sklar. After seeing him speak at the last O'Reilly Open Source convention here in Portland, and realizing I'd already read one of his other books, I decided to look at this one.
I was quite surprised! Usually O'Reilly's Learning titles are a little slow, but this one is Perfect. You start with the basics, and he's rather good at not telling you more than you really do need to know, and by the end of the book his examples have built on each other to the point that you have a wonderful and flexible library for passing data between forms, your app, and a database. His explanations are well written and not too wordy. You really come away with a much deeper understanding of the language than any other book I've read can provide.
I highly recommend this title. I'm giving it five stars. Keep up the great work, Mr. Sklar!
Fine introduction to php - Review written on October 17, 2004
Rating: 4 out of 5
83 customers found this review helpful, 4 did not.
There are more new books being published about PHP than you can shake a joystick at. PHP (along with program friends - MySQL and Apache) has become very popular among developers and web designers, and for good reason. As a programming language, it is particularly suited to web development projects, while being relatively easy to write, use and learn. More importantly, it's open-source and free, cross-platform, and widely supported.
The book, "Learning PHP5", by David Sklar, is one of the latest volumes dealing with PHP. It describes itself as "a Pain-Free Introduction to Building Interactive Web Sites" and provides a gentle introduction to the latest version of PHP, which is version 5 and only recently available.
This book is not particularly useful for those experienced already with PHP, nor for those wanting to upgrade their knowledge of PHP from versions 4 and earlier to the newest version. It probably is not particularly useful for those power programmers who need and want a deep and comprehensive coverage of the topic. But it is a very well-written and designed introduction to PHP 5 for beginning programmers or those experienced PERL, ASP, or Cold Fusion programmers who want to learn a different language. There are many illustrations and code samples sprinkled throughout the book. Sklar, however, occasionally skims over some topics in furtherance of the completion of some practical examples.
The publisher is O'Reilly Media, Inc. which seems to have an editor's policy of covering complex computer-related topics in a comprehensive manner by publishing a range of volumes covering different aspects of a topic or from different angles or for different audiences. O'Reilly also publishes volumes on moving to PHP 5 ("Upgrading to PHP 5"), detailed and technical PHP ("Programming PHP"), and a collection of solutions to common PHP programming problems ("The PHP Cookbook").
The author, Mr. Sklar, is an experienced consultant in computer software development and technical training. He is the author of "Essential PHP Tools" and coauthor of the afore-mentioned "The PHP Cookbook". He takes a deliberate and comprehensive approach to explaining PHP 5, not in great depth, but with an intent of providing enough information, concepts, detail, and scope to create a pleasant and useful read of a technical subject. The basic promise of PHP is in the relatively easy creation of more dynamic and
interesting web sites which would include, for example, product catalogs, blogs, photo galleries, event calendars, forms, and more.
There are 13 chapters and 3 appendices. The early chapters provide an orientation to PHP including its place in contemporary web development, its basic rules, and its syntax. They explain the basic background of PHP and how it interacts with the browser and web server. Later chapters introduce primary concepts like loops, arrays, and functions. The idea here is to facilitate learning the fundamentals of the grammar and vocabulary. Chapters 2 through 12 have short exercises at the end of each to allow the reader to practice writing PHP code and to test learning. (The answers are contained in Appendix C.) Experienced programmers and geeks may recoil at the inclusion of these exercises, but they are useful for beginners.
Chapter 6 provides a practical exercise - how to make and use a web form. The author shows how to access form variables, how to validate user-inputted data for security and efficiency reasons, and how to process forms using functions. Chapter 7 shows how PHP interacts with database programs, like SQL and Oracle, but focuses primarily on MySQL, and demonstrates how to organize data, connect to a server-based database, create tables, and input and retrieve data.
The rest of the middle chapters cover the use and implementation of cookies and sessions, handling dates and time, and working with files. The practical exercise using dates and times is creating and displaying a monthly calendar. The final chapters provide brief but practical coverage of XML, debugging, and in Chapter 13, other PHP aspects. PHP is amazingly useful, flexible, and practical. One can deal with graphics, pdf-formatted documents, and other media like Flash and Shockwave. It also has mailing and file uploading functions, encryption capabilities, and for more experienced coders, the ability to run shell commands. The upgraded PHP 5 has new capabilities which now include object-oriented programming.
Appendix A covers installing and configuring PHP for Windows, Mac OSX, and Linux; Appendix B is a short primer on regular expressions and how to use them with PHP.
I found the book to be the most accessible introduction to PHP I have read. It provides the basic fundamentals, engages the reader in practical examples, reinforces learning with exercises, and provides an overall perspective on the scope of PHP programming.
Code examples used in the book can be downloaded at the O'Reilly site. More information is available at www.oreilly.com/catalog/learnphp5/index.html.