Slashdot Mirror


Beginning PHP and MySQL

norburym writes "W. Jason Gilmore and Apress have put together an impressive volume, both in girth and content, in Beginning PHP 5 and MySQL, From Novice to Professional. At first glance, it appears that any technical manual that tries to approach such heady stuff such as PHP and MySQL for an audience ranging the span from beginner to the uber-geek is headed for failure. Happily, I can report that Gilmore and Apress have given the world one book that will replace many other PHP and MySQL volumes. This is one that the reader will consistently rely on and keep near to hand." Read on for the rest of Norbury-Glaser's review. Beginning PHP and MySQL: From Novice to Professional author W. Jason Gilmore pages 800 publisher Apress rating 9 reviewer Mary Norbury-Glaser ISBN 1893115518 summary PHP and MySQL

One key to the book's success is the manner in which Gilmore approaches his subjects. The text is split neatly into three sections: the first deals exclusively with PHP and comprises the bulk of the book's content, the second section goes into depth with MySQL and the final chapters deal with PHP/MySQL integration. This layout is where the promise of appealing to such a wide range of user abilities succeeds admirably. The beginner can read cover to cover and come out of the pipe with a solid, practical knowledge of PHP, MySQL and how to combine the two to build advanced web applications. An experienced MySQL or PHP guru can skip the area of his expertise and gain much from the chapters on the other. A more advanced user can use this book as reference material, skim the chapter outline, pick and choose topics of interest and quickly find the answers they seek. Everything is cleanly written, with little or no anecdotal filler or asides. Each chapter begins with a nice overview of what will be covered and ends with a brief but concise summary.

Gilmore begins with nine chapters specific to the PHP language and its many core features and extensions, taking particular care over installation and configuration issues (platform specific instructions are included for UNIX/Linux (Mac OS X users can swim in this pool very easily) and Windows), basics (data types, variables), functions, arrays, PHP's object-oriented functionality and expressions. The next ten chapters delve deeper into PHP's file and operating system functions, web form integration, http authentication, file upload management, LDAP, session management (one of the best aspects of PHP and incredibly easy to use), Web Services (SOAP, SimpleXML extensions as well as NuSOAP and MagpieRSS -- cool stuff!), security and PHP's SQLite database extension. SQLite is an exciting multi-platform database engine that will most likely prove to be hugely popular in the near future. It's interesting to note that Apple plans to integrate SQLite into their next release of OS X, Tiger. Also of note is Gilmore's well-written chapter on PHP and LDAP. He provides an extremely competent introduction to LDAP and PHP's LDAP extension. If you work in an enterprise environment, this knowledge will become an integral part of your mindset and vocabulary.

The SQL section of the book is compact and concise. Gilmore manages to take the reader through a fast but detailed introduction to MySQL. Installation and configuration, clients (the standard set and some GUI based administration clients), table structures and security/user management are all explained with precision and an eye toward practical expectations.

Chapters 26 through 30 stand out, with an integrated approach to both PHP and SQL. This is where Gilmore pulls it all together. The reader is introduced to PHP's MySQL functionality, creating MySQL database classes, indexing and searching, transactions and importing and exporting data. There are numerous excellent real-world examples throughout this section that will enable the reader to create elegant, advanced web applications.

Gilmore removes the complexity and ambiguity inherent in many technical books and gives the reader a detailed approach to these two wildly popular open source packages. Beginning PHP 5 and MySQL will definitely serve the novice, the professional and those in between. For anyone wondering what all the fuss is about with PHP or MySQL or for anyone who has wanted that one volume that will explain it all, this is definitely the book for you. It is at once an excellent tutorial and an indispensable reference manual.

You can purchase Beginning PHP and MySQL: From Novice to Professional from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

13 of 228 comments (clear)

  1. Poor choice of scope? by Jason1729 · · Score: 3, Interesting

    When starting out in a new language, I like a book like the Teach Yourself series which starts out by taking you through installing and setting up environment at a very simple level, and then goes on to examples I can skim through and quickly graduate to a referrence book or the online docs.

    Most referrence books and advanced books assume you already have a working environment and sometimes (think Java) installing and getting everything working is the hardest part.

    Once I'm passed the initial bumps though, I want a book that's aimed at advanced users, mainly because the more "beginner friendly" a book is, the lower the signal-noise ratio in the writing.

    Jason
    ProfQuotes

  2. Books? by jargoone · · Score: 1, Interesting

    Books are so 1980 to me. I know that some people rely on them, but it seems so much easier to me to find what I'm looking for on the web. Just curious: who disagrees with me, and why?

  3. Stick with PHP 4 by The_Real_Nire · · Score: 5, Interesting

    As an experienced PHP programmer, I'd HIGHLY recommend coders, especially beginners, tick with PHP version 4. I know its tempting to get the 'latest and greatest', however, v5 is still too new, and the majority of servers out there still only support v4 code, so you will run into problems if you already start using functions/methods available in v5 only, and dont own/operate/have root on the server in which your code is going to run, and only ever run.

    I don't plan to make the switch to version 5 for at least 9 months or so, when v5 becomes the true de facto.

    1. Re:Stick with PHP 4 by mgkimsal2 · · Score: 5, Interesting

      This is a great point. I think/hope that PHP5 has a faster adoption rate amongst hosting companies, but it'll still take some time.

      PHP5 *does* make sense for corporate/internal developers, or anyone else writing for a more controlled environment. For average joe, however, widespread PHP5 support is still minimally months off, if not years (I hope not!)

  4. Re:Why MySQL? create user foo createdb; by Unordained · · Score: 5, Interesting

    Last I heard, the same sorts of reasons were involved in Firebird (the dbms) not being commonly available from hosting companies -- the admin side of things isn't quite geared toward hundreds of independent DBA's all on the same server and all needing to be kept out of each others' stuff. I'm pretty sure hosting companies would also want to make sure you can't load your own modules (user-defined-functions) out of fear you might load something that crashes a lot, or has nasty side-effects. Stored-procs seem safer though. Then there's managing CPU/memory/disk resources trying to make sure no single user's queries monopolize the server (particularly badly-written queries.)

    From what I've seen, people who use MySQL rarely have a good understanding of even the fundamentals of normalization, joins (all types), the difference between WHERE and HAVING, etc. -- stored procedures, constraints, domains, triggers, etc. are just entirely lost on them. They might start to see some benefits to another server system when they run into the quirks of MySQL (and particularly its data-integrity issues, silent conversions, "transactions", etc.)

    But where's my C++/Firebird book? Or my Java/PostgreSQL book? Or my Cobol/Oracle book? What we really need to figure out is how we can learn from this duo (PHP/MySQL) what makes a good set of language bindings, a good database interface, and in general a good programmer experience. I'm sure we can improve these aspects in other languages, giving ourselves more (good) options.

  5. Re:I used to swear by MySQL by downward+dog · · Score: 2, Interesting

    They each have their place... But doesn't it seem like they're converging? MySQL used to be the "fast" one, great for reads but not writes, while PostgreSQL was the "advanced" one with transactions, views, subselects, etc. But now PostgreSQL is getting faster, and MySQL has transactions and subselects, with views and stored procedures on the way?

    So what separates PostgreSQL from MySQL these days?

  6. Re:Why MySQL? create user foo createdb; by aldoman · · Score: 2, Interesting

    mySQL (seems) to have the same limitation. Every virtual host setup I've seen uses a seperate tool for DB creation (which is highly restricted to only create DBs with the username or similar before it).

  7. Re:Why MySQL? create user foo createdb; by waynetv · · Score: 2, Interesting

    From what I've seen, people who use MySQL rarely have a good understanding of even the fundamentals of normalization, joins (all types), the difference between WHERE and HAVING, etc. -- stored procedures, constraints, domains, triggers, etc. are just entirely lost on them. They might start to see some benefits to another server system when they run into the quirks of MySQL (and particularly its data-integrity issues, silent conversions, "transactions", etc.)

    That's funny, I generally find the opposite. Because you don't have triggers (especially), constraints, etc you have to do better with your data normalization. I'm working on a SQL server project right now with little or no normalization but lots of triggers to sort it out. What a mess. You couldn't even do that with MySQL. I won't even get into the ugliness of 1500 stored procedures.

  8. Re:I used to swear by MySQL by dfetter · · Score: 3, Interesting

    There are quite a few differences, most succinctly described at http://sql-info.de/mysql/gotchas.html and http://sql-info.de/postgresql/postgres-gotchas.htm l

    PostgreSQL is under a very clear license: BSD.
    MySQL is under a very clear license, too: Whatever MySQL AB Feels Like Doing Right This Minute.

    I do not need to repeat the earlier comments about the differences between what MySQL AB promises and what it delivers, but suffice it to say that those differences are comparable to any other sleazy proprietary software vendor.
    --

    --
    What part of "A well regulated militia" do you not understand?
  9. book reviews overly positive? by discord5 · · Score: 2, Interesting

    I'm wondering if there ever was a book review on slashdot that had as a title "Don't buy this, stay clear, vaporware". I know that the general intention of book reviews is to recommend good books to others, but what about the really bad ones? Not the obvious bad ones like "Teach yourself linux in 25 minutes" or "Cooking with Penguins".

    It's just that I've never seen someone say something negative in the first paragraph of the article. It just seems like authors registered a slashdot account and started promoting their book

  10. Re:Why MySQL? create user foo createdb; by globalar · · Score: 2, Interesting

    "...what makes a good set of language bindings, a good database interface, and in general a good programmer experience."

    Amateurs can get by with minimal investment of time. Demand for simple scripting features like forums has been on the rise for years, but the demand has a low-price point. To meet this demand, a massive supply of low-end webhosting hit the market. Now the amateurs have a lot of ready-to-go PHP scripts to use and dirt-cheap webhosting. They have what they and the majority of the Internet websites can understand and want. Something like market equilbrium I suppose.

    "where's my C++/Firebird book? Or my Java/PostgreSQL book? Or my Cobol/Oracle book?"

    C++ is not even comparably friendly to PHP. No one has heard of Firebird. Java is much more than most people need - same with PostgreSQL. Oracle costs money and most people don't know what Cobol is.

    It's not about being the best. It's about being easy enough, cheap enough, and popular enough.

  11. Re:other training materials here... by imroy · · Score: 2, Interesting

    Powerful it is not. In fact, it's a fricking mess. The only thing it has going for it is that it's popular and available on almost every web host.

  12. Re:other training materials here... by imroy · · Score: 2, Interesting

    I think you missed the point of the article I linked to. You're talking mostly about the use of a language and its users. Of course a good/bad coder can write good/bad code, that's what makes them good/bad! The point, as I see it, is that PHP is really a very simple language that has been extended and hyped beyond its capacity. Of course there are places where it is well suited. Mostly simple homepages. Even Yahoo! is switching to it, but only (as I understand) as a template language. The underlying logic will be written in something else and will then throw variables at a PHP template. PHP is unsuitable as a general-purpose language, especially in large projects, because it lacks namespaces (hello global variables!) and has many ugly idiosyncrasies. The most insightful part of the linked article is on Oversimplification Leading to Excessive Complexity:

    PHP 2 was probably a reasonable solution: it was a minimal scripting language for adding dynamic behaviour to webpages. Unfortunately, PHP has since outgrown itself. PHP is nowadays a programming language simplified to the point where the available abstractions and concepts just aren't sufficient to express the programmer's intent.

    I have looked at PHP code from time to time and it has never impressed me. To me it always looks like a poor impression of Perl done by a VB coder. It's a language designed by a large group of coders who seem to have none of the insight into language design of the Perl crowd. Part of that comes down to history and experience. Perl 5 alone is almost 10 years old while PHP started only about 5 years ago. Maybe PHP5 and beyond will finally pick up the loose ends, but only time will tell.