Slashdot Log In
PHP and MySQL Web Development, 2nd Edition
from the back-for-more dept.
| PHP and MySQL Web Development | |
| author | Luke Welling & Laura Thomson |
| pages | 815 |
| publisher | Sams |
| rating | 9 |
| reviewer | Tony Williams |
| ISBN | 067232525X |
| summary | New edition to for an excellent guide to PHP and MySQL |
There is a good review of the first edition of this book here on Slashdot. For this second edition, I would add that Welling and Thomson have updated extensively and improved slightly a book that may well be the classic text on the topic.
PHP and MySQL are probably the most pervasive add-ons to Apache web servers across the web. Certainly they are both easy to acquire and common on a large range of web hosting systems, including several extremely low-cost ones. They also fit together extremely well.
This book demonstrates just how well. It starts out with a quick course in PHP (OK, 160 pages is hardly quick but it seems to move along at a good pace), follows it up with a brief look at MySQL before a short digression on E-commerce leads into building authentication and secure systems with the two tools (a marvelous place to start when you're thinking about commercial-grade web systems).
Then, after some more on PHP, the final section covers some large projects, a shopping cart, email service, mailing list manager and web forums. The final chapter in this section is new for this edition and covers XML and SOAP.
The new edition has been updated extensively. All scripts work now perfectly in PHP 4.3
I like this book a great deal. Even after a fair amount of time with the previous edition I still find it useful. It is well structured for finding what you need, well written, and has few typos. (Though there are still some, including ones in code examples -- when will authors learn to work straight off running code into the manuscript and keep godforsaken editors away from it? Brian Kernighan managed it twenty-five years ago.)
This would not be the best book if you had little programming experience, nor would it be the best book if you had a fair amount of PHP experience.
You will want to have some program design experience and preferably some experience with database design as these are given short shrift. The book also lacks examples and discussion of some of the less database intensive parts of PHP and some of the more obscure tasks you may need to perform. It covers what someone who has programmed before needs to know about both PHP and MySQL while informing on methods of using both to build practical and sturdy web applications. If that sounds like the book you want then I heartily recommend this volume to you.
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.
Why not Online Documentation ? (Score:5, Insightful)
Re:Why not Online Documentation ? (Score:5, Informative)
(http://slashdot.org/)
Re:Why not Online Documentation ? (Score:5, Insightful)
knowing the language vs knowing the ins and outs (Score:5, Interesting)
(http://www.ender.com/)
I never had a problem with stuff not working, but I did do a lot of things in ways that could have been done better. For example, not realizing at first that you could declare php functions with optional arguments (ie, function foo($x, $y=1) {}) cost me a lot of headache I didn't need. Puzzling my way through the behavior of php classes took some time, as these aren't particularly well documented (particularly variable scope in classes and methods, and the interaction between session tracking and classes).
In other words, I could have used a good 'tips and tricks' sort of book. Not basic syntax, but the sort of things you'd miss even if you got fairly far using the online docs.
The good and bad thing about PHP+Mysql is that it is a very powerful and flexible platform to develop on. But because it is SO flexible, it lets you make a LOT of mistakes. There's a big difference between a functional app, and a GOOD app.
Re:Why not Online Documentation ? (Score:5, Insightful)
Or how about on a boardwalk in Southern California, trying to code something quick enough that the Mrs. doesn't get mad at you for interrupting the vacation?
I've been in these situations, and that's why I carry the first edition of this book. Well, I used to, when I was first getting into PHP/MySQL.
I'm not saying that online tutorials is not enough. I'm teaching a class in these technologies next semester, and I am requiring the students to use online references. There are just times that you do not have access to the web and must have some info.
Re:Why not Online Documentation ? (Score:4, Insightful)
Books tend to be clearer, better-researched and more authoritative. If you already know the technology well, you can sort out the online wheat from the chaff and get what you want rapidly. If not, you flail around a myriad of web pages looking for information that fits your needs.
This applies to my experience of PHP as well as other related experiences.
Of course there are exceptions to this, but my bookshelf grows and grows. Also, if online docs are so great, how come O'Reilly books still sell so well? They're hardly cheap...
previous version was good (Score:5, Informative)
(http://blog.peoplesdns.com/)
I am sure we will be getting at least one copy of this for our office as some of the junior programmers use the books and we let them take them home.
me personally, I really only use php.net if I need to look up a function, but then I have been doing this for a long time and don't need to read about the how's and why's, just need the facts and what functions expect.
From my experience, seasoned php programmers usually have a browser open to php.net to look up functions and seldom have any PHP books.
again, however, for beginners this book series is good.
One reason why online docs are better than a book (Score:4, Informative)
An interesting side note: the MySQL people "stole" (Rasmus Lerdorf's words, not mine) php.net's webmaster. For a long time now, I've gotten very used to typing things like php.net/mysql_pconnect [php.net] in the location bar of my browser and getting redirected to the right page in the online docs. MySQL's new webmaster brought that feature with him, so you can do things like mysql.com/select [mysql.com] and get answers fast. (If you want to do this on your site, it's actually fairly simple. Check out lerdorf.com/tips.pdf [lerdorf.com]. Look midway through for a slide on the $PATH_INFO environment variable.)
The web sites obviate both books for all but beginners, IMO.
-B
Again... no best practices (Score:5, Insightful)
(http://www.afrobattle.com/ | Last Journal: Monday April 22 2002, @12:06PM)
As a member of the PHP (and Perl) faithful, when are we gonna learn that books like these give the community and open source in general a bad name?
Maybe I'm out of line in criticizing this book, maybe I'm looking for a different book, but when we have a book that covers web development best practices along with learning about PHP, Mysql and so on, then I will be the first in line to recommend and purchase it.
Re:Again... no best practices (Score:5, Informative)
(http://lobsteraliens.com/ | Last Journal: Friday November 01 2002, @12:16AM)
2. Checking input
3. Checking input!!!
4. Separation of logic from HTML design. (templating)
I don't know how many times the company I work for now has been burned because a previous programmer never checked any input to his scripts, rather just blindly inserting it into the database.
PHP 5? (Score:2, Interesting)
(http://www.seangw.com/)
backwards compat. (Score:5, Interesting)
Oh dear lord not again! (Score:5, Funny)
(http://slashdot.org/)
I know nothing will stem the tide of these, for all intents and purposes, xeroxed books, but I can at least implore (nay, beg) the people here to please, please stop sending in inept reviews/advertisements for them. There is just no damn reason for it.
First Edition was quite good. (Score:5, Insightful)
All you need to know about MySQL (Score:1, Troll)
(http://ninenine.com/)
As usual, this books is lacking on real database information because let's face it... 99% of MySQL users wouldn't know a database form a spreadsheet, and it shows. No triggers... no subselects, still?? Hell, if you don't really need a database, then there's nothing wrong with using an OLEDB connector to a CSV file.
What about Perl/MySQL or Perl/Postgres? (Score:1, Interesting)
Being based on Perl/MySQL, how about a slashdot review of a book on Perl/MySQL?
For someone who has no programming experience, if you had a choice of only one book, which book would you recommend for Perl/MySQL or Perl/Postgres? I'm on an extremely tight budget, unemployed, yadda yadda...a book with examples, or that does several run-throughs of a working site setup would be appreciated.
A big tia!
php.net (Score:5, Informative)
Re:php.net (Score:5, Informative)
(http://public.xdi.org/=dJCL)
i18n (Score:5, Interesting)
(http://www.issho.org...&pagename=LaszloBlog)
MySQL (Score:2, Informative)
When you first start out, you're happy that you can put data in and pull it back out. Then you find that your data gets inconsistent for some reason. To stop this happening, database designers put constraints on the data, and use transactions. If the job is done properly, it shouldn't be possible to insert inconsistent data, like a company address that doesn't belong to a company.
Unfortunately, if you chose to use MySQL at the beginning, you're now stuffed because it doesn't provide these features. What's worse, its SQL is rather non-standard, so you're going to have a problem moving to anything else. I know that people will think I'm trolling for Postgres [postgresql.org], but I'm not really. Use any database that supports this type of feature. There are two other open source databases which are worth a look: Firebird [sourceforge.net] and SAP DB [sapdb.org].
Re:MySQL (Score:4, Informative)
(http://focasmi.org/ | Last Journal: Saturday September 20 2003, @07:34AM)
what about PEAR and the PFC? (Score:3)
(http://www.phpconsulting.com/ | Last Journal: Monday April 17 2006, @10:40AM)
this is a great book (Score:3, Insightful)
(http://everyplace.net/)
Why PHP? (Score:2, Interesting)
(http://sharpy.xox.pl/ | Last Journal: Wednesday September 14 2005, @02:12PM)
Quotes and brackets.
Nothing evil by themselves, they are unfortunately just the same kind as used in HTML and SQL, which makes creating SQL queries on the fly, printing HTML piece by piece and a lot of similar work worst mess I've ever seen. I've been successful at creating Perl regexp patterns that needs a minute to be understood, but I've never before been tempted to try to optimise fragments of my program to anything like:
$a.='('.$_POST["it$f['n1'][$i]"]."='${q2}'
Is there any good CGI language that doesn't have this kind of problems?
Online Documentation? (Score:3, Informative)
MySQL (Score:1)
(http://www.blogeasy.com/ | Last Journal: Friday June 04 2004, @12:25AM)
Enough! (Score:2)
(Last Journal: Wednesday April 11 2007, @04:43PM)
This is one of the problems with the job market right now. Too many of the idiots who got in the business during the boom are still in. I know several of them.
No, I'm not bitter... honest
Something in the water? (Score:1)
(http://insom.me.uk/)
What am I missing? My GF was learning PHP, and she was going through the book and asking me questions when she got stuck, and during the first half (the language basics), the amount of times I had to say, 'That's a contrived example', or 'You don't do that in real code', or 'That's just an error in the book, it doesn't even parse properly', is un-funny.
With the above parsing problem, several code examples are incorrect, and also the authors use code fragments without introducing what the variables that are introduced in them are for. These variables are presumably set outside the scope of the fragment, but to what values is not made explicit.
Would it hurt to take a reasonable example, write all the code up-front, and disect it, so the user can see what input is being used to create what output?
Philip Greenspun http://philip.greenspun.com - has a section on his site called 'Internet Application Workbook'. I started Helen (the aforementioned GF) reading this, and she was put off by his tone and the lack of actual depth into languages (this book will not teach you ADP/ASP/JSP/PHP, just how to write web applications), but I think everyone should be made read this.
Perhaps Clockwork Orange style forced-reading is required.
Re:What I want to know is (Score:1)
(http://erik.mathisen.us/ | Last Journal: Saturday June 15 2002, @11:11AM)
It's right there on page 34 (Score:2, Funny)
tar xzf postgresql-7.3.2.tar.gz
cd postgresql-7.3.2
gmake
su
gmake install
adduser postgres
mkdir
chown postgres
su - postgres
-r
Re:I AM GOING TO FAIL MY LOGIC EXAM TODAY (Score:5, Funny)
Re:PHP is a mess - try out ZOPE (Score:5, Interesting)
(http://lobsteraliens.com/ | Last Journal: Friday November 01 2002, @12:16AM)
And before someone says "I don't like the crappy page that gets sent on a 500 error", with Apache you can change that error to whatever page you want.
Re:Perl (Score:1, Informative)
(http://ninenine.com/)
Please. Get a book. Oracle was a "SQL" database as you say about 20 years before MySQL ever existed. MySQL isn't even a "real" database, in the technical meaning of the word.
Re:Perl (Score:2)
If your time has any value, buy an off-the-shelf product like Joel Spolsky's FogBUGZ. Or install Bugzilla or something.
That said, your management probably
1) wants to keep you busy and doesn't consider your time an expense (at least, not until layoff time comes around)
2) is deluded into thinking they need a full-custom solution.
3) doesn't want to spend money on proprietary software.
Several weeks indeed!
Perl vs PHP question (Score:2)
Thanks.
Tor
Re:Perl vs PHP question (Score:4, Informative)
framework to work with. It's not easy to install
but you'll get a nice backend por code embedding.
Reasons to choose perl:
Separation of presentation from code: perl objects and modules.
Zillions of perl modules in search.cpan.org
Perl is a more mature language with years of existence before php. It has many more features like quite better regexpes and many more.
Re:Perl vs PHP question (Score:5, Informative)
That kinda sums it up. If you have no problem with the somewhat bizar syntax of Perl you're in. Perl is powerfull and present on allmost anything that runs even the faintest resemblence of Posix. It' ancient and so are it's homegrown semantics. If you know Unix well, take Perl. You'll feel right at home. You'll have to add AxKit, Petal (the Perl rippoff of Zope's TAL) or some other stuff to make it practically usable for larger webstuff and it will probably be slower than PHP, but therefore it's a very universal PL.
PHP on the other hand is the worlds prime dynamic web content language because it's built for, would've you guessed?: dynamic web content.
It's a subset of the large families of SSI-technologies (server-side include) like ASP (don't!), JSP (ok if you're running java), ColdFusion (don't!) and the likes. It's fast, has a bazillion readymade free products ready and beats the living crap out of Perl when it comes to developing dynamic web content. PHP projects make up the lions share of anything serious on the web. You don't need to set up Petal or AxKit/XML or whatnot to get a descent template-engine (as you'd have to with perl) but therefor it gets unpratical when you want to use it for something else then dynamic web stuff. Allthough there's a PHP-GTK lib available that let's you make 'real' apps too.
If you're mainly into dynamic web stuff take PHP. If you emphasise on Unix/Linux admining and scripting take Perl.
And take a look at Python and Zope beforehand - those are *my* favourites.
Re:PHP is a mess - try out ZOPE (Score:1, Insightful)
You're a dumb ass. You can set the error handling in PHP quite easily and if you're stupid enough to not check your input before you do an insert then you deserve what you get.