PHP and MySQL Web Development
PHPee writes ""Learn the concepts and build the applications..." - PHP and MySQL Web Development is a well-written web developer's guide to using these open source products to create dynamic websites quickly and easily. This book covers everything you need to design, build and debug your own website from the ground up. Special attention is paid real-world issues, like database normalization and site security. Overall, a great reference for beginner and more advanced programmers alike." Read on for the rest of his review.
PHP and MySQL Web Development
author
Luke Welling & Laura Thomson
pages
896
publisher
Sams
rating
9/10
reviewer
PHPee
ISBN
0672317842
summary
From hello world to e-commerce in under 900 pages...
Part Two The following section focuses on MySQL, starting by explaining the advantages of a relational database vs. a flat file storage system. The book assumes no knowledge of databases, explaining simple terms such as tables, columns, rows, etc. It then progresses on to the fun stuff, like designing databases for the web and normalization.
Part Four This section of the book expands on part one, delving into some more advanced PHP techniques, such as interacting with the file system, using network and protocol functions and generating images on the fly with the gd library.
This section also looks at PHP's powerful session functions, including using sessions with authentication and the use of cookies.
Part Five This is by far the most exciting section of the book. Here the reader is presented with seven real-world examples that utilize most of the issues presented throughout the book. These practical projects are presented in an easy to follow manner. The basic problem is presented, and then a solution is proposed. The authors take you from start to finish, outlining the database design, necessary files and functions and show you how to tie it all together. They are also very good at pointing out possible enhancements or alterations, hopefully inspiring the reader to develop their skills and create something beyond the scope of the book.
The seven projects are as follows:
Each of the projects has a real-life application, and can easily be modified to fit the needs of almost any website. The shopping cart application is quite complete, and could serve as a basic cart as-is. The web-based email service incorporates the IMAP and POP3 protocols in an easy to understand manner. And the web forums project discusses the complexity involved in creating a threaded discussion board. It even refers to slashdot as a "fantastic example of a popular website that uses discussion boards" :)
Other info: There are a few minor typos and errors in the book, but nothing to get angry at the authors about. Most of them are quite negligible, but may still create some frustration for beginners. (For example, they make reference to a function isempty(), which does not exist in PHP. The real function is simply named empty()...) Small errors like this may create some confusion, but the errata listed on the author's website are quite helpful, yet not all-inclusive.
The appendices do a good job of showing you how to install apache, PHP and MySQL to get up and running under both Linux and Windows. The book also comes with a CD that contains a PDF version of the entire text, all code examples, and copies of PHP and MySQL so you can set up your own development environment at home.
Overall The book is targeted toward intermediate to advanced programmers, but I'd suspect it would be more useful to the beginner to intermediate group. However, the book is organized in a way that accommodates beginners and more advanced users. If you have previous programming experience, you can probably skip some of the early chapters and jump straight into the larger projects. It's a handy reference book, nonetheless. This book covers almost everything you need to know to learn how to use PHP and MySQL to create dynamic, database-driven websites in no time at all. It does an excellent job presenting some real life projects, and the emphasis on security and clean code is consistent throughout the entire book.
The authors of the book (Luke Welling and Laura Thomson) do a great job of introducing new programmers to the world of PHP and MySQL. The book is divided into five sections which take the beginner programmer through many lessons in solid, secure web programming.
Part Two The following section focuses on MySQL, starting by explaining the advantages of a relational database vs. a flat file storage system. The book assumes no knowledge of databases, explaining simple terms such as tables, columns, rows, etc. It then progresses on to the fun stuff, like designing databases for the web and normalization.
Particular attention is placed on MySQL's privilege system, including proper use of the GRANT/REVOKE commands to give/take away rights for database users. This section is quite detailed and offers a lot more information than I expected. The various column types and associated keywords are also examined in great detail, providing the reader with a solid understanding of MySQL's main features.
Part Three Part Three of the book examines the issues associated with running an e-commerce site. This section is nicely done, looking at common mistakes and how to avoid them. These include things like server security, data backups, keeping detailed logs and dealing with other threats, such as crackers, denial of service attacks and destruction of data. Authentication methods and encryption schemes are also thoroughly covered.
Part Four This section of the book expands on part one, delving into some more advanced PHP techniques, such as interacting with the file system, using network and protocol functions and generating images on the fly with the gd library.
This section also looks at PHP's powerful session functions, including using sessions with authentication and the use of cookies.
Part Five This is by far the most exciting section of the book. Here the reader is presented with seven real-world examples that utilize most of the issues presented throughout the book. These practical projects are presented in an easy to follow manner. The basic problem is presented, and then a solution is proposed. The authors take you from start to finish, outlining the database design, necessary files and functions and show you how to tie it all together. They are also very good at pointing out possible enhancements or alterations, hopefully inspiring the reader to develop their skills and create something beyond the scope of the book.
The seven projects are as follows:
- User authentication and personalization
- Shopping cart
- Content management system
- Web-based email service
- Mailing list manager
- Web forums
- Generating personalized documents in PDF format
Each of the projects has a real-life application, and can easily be modified to fit the needs of almost any website. The shopping cart application is quite complete, and could serve as a basic cart as-is. The web-based email service incorporates the IMAP and POP3 protocols in an easy to understand manner. And the web forums project discusses the complexity involved in creating a threaded discussion board. It even refers to slashdot as a "fantastic example of a popular website that uses discussion boards" :)
Other info: There are a few minor typos and errors in the book, but nothing to get angry at the authors about. Most of them are quite negligible, but may still create some frustration for beginners. (For example, they make reference to a function isempty(), which does not exist in PHP. The real function is simply named empty()...) Small errors like this may create some confusion, but the errata listed on the author's website are quite helpful, yet not all-inclusive.
The appendices do a good job of showing you how to install apache, PHP and MySQL to get up and running under both Linux and Windows. The book also comes with a CD that contains a PDF version of the entire text, all code examples, and copies of PHP and MySQL so you can set up your own development environment at home.
Overall The book is targeted toward intermediate to advanced programmers, but I'd suspect it would be more useful to the beginner to intermediate group. However, the book is organized in a way that accommodates beginners and more advanced users. If you have previous programming experience, you can probably skip some of the early chapters and jump straight into the larger projects. It's a handy reference book, nonetheless. This book covers almost everything you need to know to learn how to use PHP and MySQL to create dynamic, database-driven websites in no time at all. It does an excellent job presenting some real life projects, and the emphasis on security and clean code is consistent throughout the entire book.
You can purchase PHP and MySQL Web Development from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
I know this is going to sound terribly odd (and might make me come off as a total n00b) but I'm going to go out on a limb here and say that PHP doesn't need a debugger (at least not yet). Really, I've been playing around with PHP for months now, playing around with string functions, loops, databases, recursion, and the like and I've never need any debugging tool more advanced from echo.
I've found that it's very hard to make insidious and hidden errors in PHP if you just plan your code well and are familiar with the language. Most of the errors I make in PHP tend to be of the "Oops, missed out a semicolon" variety, so the simple one-line error "Parse error at line X" is generally enough for me. Even the most complex errors I make (such as when mysql_num_rows complains about a variable not being a MySQL result) is due to something boneheaded and reasonably obvious, like forgetting to connect to a database or missing out a line of code.
Even without a debugger, I've never had to puzzle over any PHP problem for more than a few hours.
Note to M1-ers: a curt but otherwise insightful message is not "Flamebait" or "Troll".
I will agree to an extent...
When I am writing a web-app... I will often go to their sites as a reference... however, I find that the examples are sometimes lacking.
MySQL's site is rather poorly laid out and makes assumptions that you already know all there is to know about MySQL - pretty good reference, poor for learning from.
PHP's website is excellent - again though - not a great learning source... there are user submitted examples - but they aren't moderated or proofread... so are often garbage.
I think I've learned more about PHP/MySQL from books and PHPBuilder than I have from the actual PHP/MySQL sites...
BlackNova Traders
Especially when you've got dozens, or even hundreds, of SQL servers.
You have hundreds of servers, each running a seperate, individual copy of MySQL, with multiple databases on each?
If I were you, I wouldn't worry about the uptime of your MySQL instances -- in my experience, that's rarely a problem. I would, however, worry about the intellectual capital you're expending to catalog and manage hundreds, or perhaps thousands, of databases.
Simply dealing with the administration requests for database permissions and roles must be a full time job for several people. The dozens of people required to understand and manage the schemas for those databases must be a huge drain on your organization.
I suspect that using Oracle or MS SQL would save your organization literally millions of dollars a year, simply because of the improved management interfaces and flexibility of the databases as a whole.
Slashdot is jumping the shark. I'm just driving the boat.
I have never had any problems with php, because of the excellent, (almost?) clearly written documentation.
However what have suprised me on local php developer forums is that people completely new to any kind of programming find the site very technical and difficult to understand. Therefore will they often seek for alternative resources, like books or websites.
As you mentioned the free php projects, I have to say that I don't think that you can get very much out of those. I find it much better to look at small snippets than large projects, because it's much easier to understand. Especially for beginners.
I demand the Cone of Silence!
Total-noob> but I'm going to
Total-noob> go out on a limb here and say
Total-noob> that PHP doesn't need a
Total-noob> debugger
That sounds like something that a sales 'droid
said to my manager concerning a 4GL back in the
early '90s. My manager bought it. I have to
admit that, in the beginning, I was taken in, too;
but in the end this turned out to be an instance
of wishful thinking.
We tried to develop a modest user interface to
track the flow of materiel through a shipyard in
this 4GL. Of course, the implementation tuned out
to be much more intricate in the real world than
it had seemed to be in the 'blue sky' concept and
planning meetings.
End result: the 4GL code was almost impossible to
maintain. Eventually the project failed --for a
combination of reasons, to be fair. Here is a
king of maxim that I took away from it though:
Every line of code that is ever written will have
to be
1-debugged
2-maintained
This isn't a troll but a real answer. Almost nothing.
Perl is more concise, has a superior collection of modules, is mature and has a more planned feel (for example, the whole register globals thing, or the changing of global array names in PHP are evidence of this). These things make perl eaiser and mroe productive to work with.
Other people (not me ;) ) like PHP because they say it has a lower barrier to entry so that less experienced developers can get up to speed faster. There's usually some comment about readability, but I think that's a bit of a red herring. Using Mason or Ax Kit or (insert templating system here) in perl will get you that much beloved separation of code and presentation that PHP tries so hard to discourage.
And after all that, I use PHP almost exclusively now. The biggest reason is deployment. I work on sites on numerous servers, and I never know where things will live. It got to be too much of a headache making sure the appropriate perl modules (eg, DBI) would be available. My biggest wish for Perl 6 isn't easier to read regexes, it's some kind of SDK system, where sysadmins can install perl with the Web Development SDK, or the what have you.
sigh. I miss perl.
This is the voice of World Control. I bring you Peace.
The other thing with PHP is that there are now so many free projects using PHP it is often a lot better to look at they are coded, I think you gain a lot more pratical knowledge this way than you could glean from any book no matter how exhaustive.
/. folks know the benefits of reusing code in this way, but doing so without knowing what it's doing is risky business. I don't think I need to explain why.
The only problem I have with this is that sometimes new programmers want to use this copy-and-paste style coding before they really understand the language. I mean, most
For that reason, there certainly is a place for beginner books, as this one seems to be.
-- "Complacency is a far more dangerous attitude than outrage." -Naomi Littlebear
bp
It is nearly impossible to develop a portable PHP application. You never know what features are available in the installation a client uses. I want a stable development platform dammit, if I'd been looking for an mediocre ad-hoc syntax to access a huge and useful, but ever-changing and frequently buggy library, I'd use VB.
Programming can be fun again. Film at 11.