Core Web Application Development with PHP & MySQL
jsuda writes "Core Web Application Development with PHP and MySQL is an intermediate
to advanced-level guide for programmers and developers. It bills itself as >everything
one needs to know about building robust database applications. That is a
bit of puffery but this is a comprehensive practical guide for designing and building
production-quality, database-enabled applications." Read the rest of John's review.
Core Web Application Development with PHP & MySQL
author
Marc Wandschneider
pages
912
publisher
Pearson Education
rating
8
reviewer
John Suda
ISBN
0131867164
summary
Fine strategic overview
The author is an open-source platform expert and software developer. He comes from a background of working with standard desktop Windows-based applications and made the transition to building dynamic web applications. His experience in making the transition informs this book as a comprehensive explanation of how to use the various technologies that go into writing web applications. For those making similar transitions, this is a very fine presentation done by a thoughtful, systematic designer. For those already busy in the PHP/MySQL area, the advanced level of instruction is likely to be valuable.
The emphasis is on open-source applications, particularly PHP5 and MySQL in an XHTML/Javascript environment. But, beyond technologies, the author's focus is on the strategies and systematic approach one needs to design and implement successful web applications. He writes for an advanced audience which is already basically familiar with programming and XHTML. Those writing or planning dynamic web applications will benefit most from the book.
There are 33 chapters in five parts - basics of PHP, database basics, planning web applications, implementation, and sample projects. There are three appendices covering installation and configuration of PHP, MySQL, and other related open-source applications like Apache, a set of charts of database function equivalents among the leading database types - MySQL, Oracle, PostgreSQL, Microsoft SQL Server, and a short list of recommended reading.
This is a large format book of 912 pages, including index. My reviewer's copy is a prepublication version containing grayscale graphics and much white space, especially around the code snippets, making reading easy and comfortable. Although the material is high-level and technical, the writing seems light and casual. Wandschneider's writing style flows easily, never bogs down even with technical details, and the book reads much faster than one might expect.
Although the best part of the book contains the three start-to-finish sample projects at the end - a calendar system, weblog engine, and e-commerce store, the lead-in chapters are nicely done, too. Chapters 1 and 2 are about getting started in PHP. There is a brief comparison to perl and C++, but the bulk is about PHP terminology and programming concepts. Much is made of PHP5's new object-oriented features, but the discussions of that here (and in Chapter 4) was about the only parts which I feel needed more clarity - the rest of the chapters are very clearly stated and contain plenty of good examples.
Chapters 3 - 7 continue with scripting concepts like functions, classes, arrays, strings and characters. The discussion is not designed to instruct comprehensively about PHP itself but works on a higher level of showing how PHP interacts with MySQL and other technologies on an overall basis. You can get detailed PHP coding instructions elsewhere. Chapter 6 contains an unusually good discussion of character sets, usable for global applications, and provides instructions on configuring Unicode and multi-byte support for high-level applications.
Part 2, Chapters 8 - 12, take the same approach to MySQL and databases in general. They include discussion of basic terminology and concepts, designing and creating databases, storing and retrieving data, PHP-to-database connectivity, and advanced topics, like use of "transactions" and advanced querying.
Part 3, Chapters 13 - 17, deal with the server-side matters. Again, the level of presentation is not on comprehensive details of PHP, MySQL, and web services, but present a comprehensive overview to guide planning, design, and implementation. Here the author states overall design considerations of a website noting how to incorporate CSS, HTML, code libraries, user interfaces, and web services into a working dynamic website.
User management and security concerns are noted throughout the book and Chapters 14 - 17 deal specifically with validation, and software and hardware security, including tips on how to secure your server. These passages on security are some of the better and clearest written I've experienced in this area.
Part IV continues the systematic approach to website construction discussing error handling, debugging, cookies, and sessions (again some of the clearest explanations I've read), authorization, and data validation with regular expressions. Chapter 21 is entirely about globalization and localization that is, dealing with the fact that the Internet is global and that there is a need to deal with foreign language sets. There are tips on how to determine users' locations and how to script to account for different language sets, including Unicode.
Chapters 23 and 27 are about XML and are especially useful now that XML and XHTML are becoming the reigning protocols of dynamic web activity. There is an extensive sample of using XML to work with the Google API. Using XML with PHP is an advanced topic and it is only generally covered here, together with XML web services and SOAP. Other chapters cover the use of extensions to PHP, like PEAR, developing a coding "style", creating test suites, configuring PHP.ini, and more. The three working examples are extensively commented and contain complete code examples.
The book comes with a comparison CD-ROM containing all of the sample code, and versions of PHP5, MySQL, and Apache HTTP server."
You can purchase Core Web Application Development with Php & MySQL from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
The author is an open-source platform expert and software developer. He comes from a background of working with standard desktop Windows-based applications and made the transition to building dynamic web applications. His experience in making the transition informs this book as a comprehensive explanation of how to use the various technologies that go into writing web applications. For those making similar transitions, this is a very fine presentation done by a thoughtful, systematic designer. For those already busy in the PHP/MySQL area, the advanced level of instruction is likely to be valuable.
The emphasis is on open-source applications, particularly PHP5 and MySQL in an XHTML/Javascript environment. But, beyond technologies, the author's focus is on the strategies and systematic approach one needs to design and implement successful web applications. He writes for an advanced audience which is already basically familiar with programming and XHTML. Those writing or planning dynamic web applications will benefit most from the book.
There are 33 chapters in five parts - basics of PHP, database basics, planning web applications, implementation, and sample projects. There are three appendices covering installation and configuration of PHP, MySQL, and other related open-source applications like Apache, a set of charts of database function equivalents among the leading database types - MySQL, Oracle, PostgreSQL, Microsoft SQL Server, and a short list of recommended reading.
This is a large format book of 912 pages, including index. My reviewer's copy is a prepublication version containing grayscale graphics and much white space, especially around the code snippets, making reading easy and comfortable. Although the material is high-level and technical, the writing seems light and casual. Wandschneider's writing style flows easily, never bogs down even with technical details, and the book reads much faster than one might expect.
Although the best part of the book contains the three start-to-finish sample projects at the end - a calendar system, weblog engine, and e-commerce store, the lead-in chapters are nicely done, too. Chapters 1 and 2 are about getting started in PHP. There is a brief comparison to perl and C++, but the bulk is about PHP terminology and programming concepts. Much is made of PHP5's new object-oriented features, but the discussions of that here (and in Chapter 4) was about the only parts which I feel needed more clarity - the rest of the chapters are very clearly stated and contain plenty of good examples.
Chapters 3 - 7 continue with scripting concepts like functions, classes, arrays, strings and characters. The discussion is not designed to instruct comprehensively about PHP itself but works on a higher level of showing how PHP interacts with MySQL and other technologies on an overall basis. You can get detailed PHP coding instructions elsewhere. Chapter 6 contains an unusually good discussion of character sets, usable for global applications, and provides instructions on configuring Unicode and multi-byte support for high-level applications.
Part 2, Chapters 8 - 12, take the same approach to MySQL and databases in general. They include discussion of basic terminology and concepts, designing and creating databases, storing and retrieving data, PHP-to-database connectivity, and advanced topics, like use of "transactions" and advanced querying.
Part 3, Chapters 13 - 17, deal with the server-side matters. Again, the level of presentation is not on comprehensive details of PHP, MySQL, and web services, but present a comprehensive overview to guide planning, design, and implementation. Here the author states overall design considerations of a website noting how to incorporate CSS, HTML, code libraries, user interfaces, and web services into a working dynamic website.
User management and security concerns are noted throughout the book and Chapters 14 - 17 deal specifically with validation, and software and hardware security, including tips on how to secure your server. These passages on security are some of the better and clearest written I've experienced in this area.
Part IV continues the systematic approach to website construction discussing error handling, debugging, cookies, and sessions (again some of the clearest explanations I've read), authorization, and data validation with regular expressions. Chapter 21 is entirely about globalization and localization that is, dealing with the fact that the Internet is global and that there is a need to deal with foreign language sets. There are tips on how to determine users' locations and how to script to account for different language sets, including Unicode.
Chapters 23 and 27 are about XML and are especially useful now that XML and XHTML are becoming the reigning protocols of dynamic web activity. There is an extensive sample of using XML to work with the Google API. Using XML with PHP is an advanced topic and it is only generally covered here, together with XML web services and SOAP. Other chapters cover the use of extensions to PHP, like PEAR, developing a coding "style", creating test suites, configuring PHP.ini, and more. The three working examples are extensively commented and contain complete code examples.
The book comes with a comparison CD-ROM containing all of the sample code, and versions of PHP5, MySQL, and Apache HTTP server."
You can purchase Core Web Application Development with Php & MySQL 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 was excited about it, until i realized my 'early pass' was nothing more than a book slashvertisement.. shame on you slashdot.. tisk tisk
Must take up a lot of shelf space.
I'll have to check it out!
"Ein Volk, ein Reich, ein Führer." -Adolf Hitler
"We are one Nation, we are one People." -The One 'leader'
and queue the myraid of posts about why $_ is better than php-mysql...
It's like I read the table of contents.
An honest question for anybody to answer. Do most people still learn by picking up a 900+ page book rather than learning from example? I find most technical books extremely difficult to finish so I very rarely attempt to read them.
bluespaceradio.com - New Wave, Indie and Alternative
infinitesimall7 vitality. Like an IF *BSD IS TO all over KAmerica
Does anyone know of a good debugger for PHP applications? I'd like to be able to step through the execution of a php script...
http://www.cgisecurity.com/database/mysql/
everything one needs to know about building robust database applications.... with MySQL?
And if you believe that, I'm writing a book about creating mission critical, real time database apps using flat files and XML.
I don't respond to AC's.
Who needs to use PHP when you can use Ruby on Rails. I'm dead serious. PHP is so cryptic compared to RoR.
I can't understand how a book which (according to the review) doesn't have a chapter dedicated to the concept of "multi-tier programming", can have the presumption to say it's '>everything you need'. Heck, it doesn't even MENTION templates.
As some of you know, multi-tier applications have (at least) 3 tiers: Database, business-logic, and interface. Java guys know this better: Model-View-Controller.
I have implemented for my webapps an MVC framework, and maintaining them or modifying them is a piece of cake. It's so easy i get bored with it sometimes.
In comparison, recently I've had to adapt the OSCommerce 2.2MS2 (built in PHP) for one of our clients' store. Every single php file in it has database, business-logic and interface ALL MIXED. The only separation they have is wrappers around SQL functions (that's not true separation, but a mockery). Maintaining it is a LIVING NIGHTMARE.
So please do yourselves a favor: Study the MVC approach and implement an MVC framework in PHP. You can use any templating library you can find. (for database, i use an adapted version of phplib's sql library). This alone has saved me not hours, but weeks of work, and is worth ">everything" you could learn from that book.
Bringing MySQL compatibility to PostgreSQL
Ebay changes their site, a week before Christmas. These people are stupid. These people are astoundingly stupid. If you looked up STUPID in the dictionary it wouldn't have the eBay logo, but direct you to an encyclopedia which has more space to go on about their profound acts of stupidity, when they've been stupid, how they've been stupid and how they've often failed to repeal their stupidity or even learn from it.
They aren't the only guilty ones. Less is More and too often I've had to deal with sites poorly constructed, as replacedments for sites which worked quite well.
Probably more along the lines of programing and some Gee-Whizzy things, but every web programming book should dedicate a chapter on when and how to make changes and common pitfalls to avoid.
A feeling of having made the same mistake before: Deja Foobar
Looks like CyricZ's going to be wearing out another keyboard spewing anti-php FUD.
How can anyone get so exercised about a programming language?
grammar-lesson free since 1999. (rescinded - 2005)
Most of the MySQL using code I've seen out there doesn't use transactions, but instead just trusts that changes will be independent and take effect. Jumping to an ACID compliant (by default) database won't make a huge difference if you're not using proper transactions anyways. Although the better multi-join query performance may help.
I guess someone is rehashing this review. If you stroll down the Amazon page for this book, you get the same review text found in this Slashdot article but dated 10/30/2005. So much for submitting an original review. Then again this is Slashdot.
Why should I have to pay for this book?
Books should be free.
The writer can make money by providing support - like answering my questions or better yet...he can get a job flipping burgers.
"Core strategic web application paradigm development with AJAX, Synergistic go-to-market edition"
your own bber for a living got To them...then to stick somethinG Don't walk around And easy - only Rivalry. While
The fact that you believe that implementing an MVC pattern to organize your UI layer
Oh please, Where did I say i used all that just to implement my UI layer?
Maybe if you paid enough attention to what I said, you'd have realized that I never implied "templates = multitier". Templates are a NECESSARY part of the view, but they alone don't make a multi-tier app.
To clarify, this is how i build my web-apps:
a) I have the main ".php" files which implement the Controller. Actually i use a prepend that includes them, but that's my approach. Each main php file has a function "handle_request()" which does all the processing. I came with this concept while studying Apache Velocity. The main php files include() the particular libraries used in the model, which is split between the business and data-tier.
b) Also, the prepend.php includes (engine.php), which itself include()s security.php. I call this is the "security tier" which lies on top of the controller. The security tier verifies that no weird requests are done, and filters the unnecessary global and environment variables. It also checks the login, session, etc.
c) For the database class I used, has two subclasses: one for reading the data, and another for writing. These can have two different users connected to the MySQL database. All database operations are done thru these classes, saving the app from SQL-injections in read-only queries. Also, having the controller embedded in a function saves us from global variables injection and other nastiness.
d) The controller arranges the GET and POST parameters into an associative array, which it passes to the appropriate business-tier function. In reality, I have the business and data-tier a little bit mixed, but it's organized enough that it doesn't give too much trouble.
e) The business-tier returns another set of parameters, which are to be passed (later) to the template (which template to use is calculated also based on GET and POST, even SESSION).
f) Finally, the controller returns in an associative array, the template file and the e) parameters to the engine.php, which uses a template object to process the output.
As you can see, while processing I do not use a single echo statement. All the data (database output) is passed thru associative arrays. In other frameworks, I'd have returned an XML string which would be passed to an XSLT engine.
So, I hope that's multi-tier enough for you. If you were so kind to show us how YOU implement your multi-tier apps (you didn't), I'd really appreciate it.
Having written a blog engine myself using PHP and MySQL and given it away as open source, I'm wondering what he calls "robust code" too... I'm a professional developer in the daytime, and no book code I have ever seen has been good enough for other people to pick up easily (not enough conventions etc).
If you're interested in my project by the way, head on over to the PluggedOut Blog project.
Jonathan Beckett http://www.pluggedout.com
Why? Because of maintenance. But templates are supposed to make it easier to maintain aren't they.
No. Templates are there to add another layer of complexity to an app. Seperating the html from the php so that the designers are not confused? Hire better designers. Easily allow you to modify the site?
Well yeah if you think changing the color is a modification that should be in the html (should be in css) then yeah.
Perhaps I only seen bad implementiations of templates but in my experience the end result was always that you could never tell wich part of the fucking site was controlling what and that even simple modifications meant you had to figure out the template engine being used.
In my experience sites either have tiny changes that can be done by the coder and designer working together in a good team OR should have been in css anyway. The big redesigns usually require a code change anyway.
Worse, I had to handle more then one site where the answer was simple, Oh you want that change, sorry no that can't be done in the template. Template changes is for cosmetic changes, not functionality changes. Most buyers of e-commerce sites just don't seem to realize it. They think template means you can change your website. Yeah, in the same way a skin can change your winamp/xmms.
Perhaps I just build my sites wrong, I tend to make the html and php far to intertwined with a lot of the html being build by the code not just the php filling in certain blanks.
Database abstraction is usually defended by how easy it makes it to switch databases without having to switch code.
Eh yeah right. How often does this happen anyway? Like the site redesign it just is not a frequent occurence. Worse you often find that in favor of abstraction they leave out nice handy features one database supports but nobody else. Mysql_return_id. Every handy and only done by Mysql.
Again perhaps it was just bad experience but I seen several cases where the abstraction layer used did not support this feature forcing me to code around it. Extra PHP code to handle stuff already in the engine. Oh I am happy now!
The company that insisted the most on the abstraction NEVER switched in the two years I was there. Extra code extra bugs for something that is never used.
Image this in the real world. Your car doors being welded shut because one day you might want to turn it into a race car. WTF?
What is my point? Well that theory and practice do not mix. Yeah I 3 tired apps are usefull sometimes BUT that does not mean every bloody application has to use it. Database abastraction is usefull for code that is certain to grow. 99% of websites do not. Templates are usefull when you know you will get a lot of requests for cosmetic changes that are to big to complex to fit into css.
As for the whole saving you hours of work deal. At how many hours cost? I once read a quote that went something like this, "Do not code for code re-use unless you know in advance you are going to re-use it at least 3 times. Else the time coding for re-use will simply not recovered".
It made a lot of sense.
Perhaps I am just allergic to buzzwords.
MMO Quests are like orgasms:
You may solo them, I prefer them in a group.
Save yourself $7 by buying the book here: Core Web Application Development with PHP & MySQL. And if you use the "secret" A9.com discount, you can save an extra 1.57%!
The submitter of the review on amazon is "John A. Suda" and the submitter here is "jsuda" AND his amazon nickname is "jsuda1". I give it a 99.9999% probability that "John A. Suda" (aka "jsuda1") and "jsuda" are the one and the same. jsuda, here, just apparently decided to wait...almost two months before submitting it here.
Parent got it right on it not being exactly an original review, but at least Joe Bloe didn't (well, 0.0001%) submit John Suda's review.
:wq
Must be why everyone is using Postgess... OH WAIT! NOT!
The text violated the Slashdot review guidelines: "If you've reviewed the book elsewhere anywhere besides a personal home page (for instance, on Amazon) please be sure that your review for Slashdot is substantially different."
PHP programming is becomming about the libraries. Smartyhttp://smarty.php.net/ - a template library makes putting coherent websites together easier. Although it doesn't do anything for the database part of the site, its one less thing to worry about.
e ator/reference/quicktour/2/flash/index.html
PEAR confused me and I was programming before it so I have my own libraries. The php web documentation is excellent.
although the java studio creator is now free, and seems like an amazing tool, its not enough to get me away from php
http://developers.sun.com/prodtech/javatools/jscr
A book on PHP and MySQL. I've been waiting for this for ages!
Really, this is just what we needed.
We suffer more in our imagination than in reality. - Seneca
There, much better. :-)
Save yourself $7 by buying the book here: Core Web Application Development with PHP & MySQL. And if you use the "secret" A9.com discount, you can save an extra 1.57%!
Protect your browser with the Force Safe Search add-on
MINUS: if i wanted to read the Table of Contents, I would go to google print or B&N - what a worthless review.
PLUS: I own this book. It's actually very good.
As for the whole saving you hours of work deal. At how many hours cost? I once read a quote that went something like this, "Do not code for code re-use unless you know in advance you are going to re-use it at least 3 times. Else the time coding for re-use will simply not recovered".
;-) )
:)
;-) Actually, I think we all are.
I use my framework in 5 different intranet developments (two for the same company), so yes, it has saved me a lot of time.
In fact, to start a new development, I just copy the code from the OTHER development and just erase the particular php / template files, and modify the config.php file. Ta-da.
I made the basic framework in about 3 weeks, in my previous job. I adapted it (and improved it) to my current job where I made my first development with.
About database abstraction, I agree with you. In my pre-previous job we had to stick to "standards" because our clients wanted to use Informix for later. Pfft... all the sql code was too generic and slow. Since at my current job we're using MySQL and not changing, I can use the proprietary features.
My templates are php-based (google for "Beyond the Template engine"). So the templates have mixed PHP and HTML, this is a very powerful approach, since it overcomes the "oh sorry that can't be done from the templates" limitation in most templating engines.
In fact, if I was ever forced into using (eeew) smarty or other template engines, I would stick my "php-templating" class and use smarty only for the cosmetic changes.
My modified class allows me to use sub-templates, so i have a "main" template (i.e. logged in / guest) for the main site look-and-feel, and a "body" template which deals with the web app.
In my development i often generate excel spreadsheets. So I can choose between an HTML and an EXCEL template. Since both of them are PHP-based, i have no problem, it's the same data. (I used PEAR spreadsheet class to generate the excel. Not what you'd expect from a "template", would you?
This is the true power of templates
Perhaps I am just allergic to buzzwords.
Yes, you are
*sigh*
"He was a wise man who invented beer." - Plato
Right, and now you put your own associate tag in the link. What a fucking n00b.
> Sounds like a moving target to me. No matter what mysql does (or doesn't do), it will never be "good enough", because
> elitists will always need something to bash. Even if it was just the postgresql codebase renamed. It would still
> "suck" because it's "mysql".
nah, once the capability = the hype, then there will be other targets for scorn.
> Sorta like the (open|free|net)bsd zealots who bash linux. They're so insecure in their choice of OS
> that they need to put down something else in order to feel better.
nice, a faith-based argument in which facts don't matter - and even pointing to short-comings in a product just proves you're wrong.
Kind of like:
Brian: I'm not the Messiah! Will you please listen? I am not the Messiah, do you understand? Honestly!
Woman: Only the true Messiah denies His divinity!
Brian: What?! Well, what sort of chance does that give me? All right... I AM the Messiah!
Followers, en masse: He is! He is the Messiah!
It was supposed to be a joke. I "fixed" the referral link. Then I went out on a limb and I included this new thing called a smilie...
:-)
...that all the cool, hip, and with-it kids are using to convey humor on the Internet. It's brand new, so you may not have heard about it yet.
Protect your browser with the Force Safe Search add-on
Anyones choice of "programming" language (ahem...) aside, but I find it kind of silly that people are still building apps that use relational back end AND use XML (and that includes XHTML) to communicate with user agents. That's like "so nineties" :) Wouldn't it be a bit (or a lot?) more efficient (not to mention elegant) to store data in a native XML database?
And not have a single line of SQL in sight...
you give too much importance to a humble 'l'.
maybe freud can toy with this fact for a while.