Download the authoritative guide: Cloud Computing 2018: Using the Cloud to Transform Your Business
Core Web Application Development with PHP and MySQL is a new addition to the Prentice Hall Core Series of books. It aims to present a complete approach to the development of web applications using the very popular PHP scripting language and MySQL database engine. Full coverage of topics such as design, security, database optimization, and internationalisation are included, as well as three complete web application samples to run and experiment on. In this article, we interview the author of the book, Marc Wandschneider, who has been programming in various professional and open source degrees for well over a decade now.
LinuxPlanet: Why did you set out to write this book?
Marc Wandschneider: Over the years, I've put together a number of small web applications or web sites for various small businesses and charities. Despite being a very accomplished programmer with over a decade's worth of experience, I always found myself floundering and making a lot of mistakes as I adapted to a completely new way of writing "programs." At the same time, I was shocked at how unbelievably productive PHP was as a language. I was able to crank out large amounts of code in short order.
After writing a number of web applications and slowly learning the answers to the questions I had been asking, I decided to sit down and write a book about my experiences. Instead of just being a tutorial into a number of topics like such as PHP, MySQL, and relevant technologies such as sessions and cookies, I decided to write a book that worked the developer through the questions and processes required to write robust web applications.
LP: There are a good two-dozen or more other books on the same subject matter. Why is yours special?
Wandschneider: There are a number of good PHP books available today for purchase, but the one thing I found lacking in most of them is a systematic approach to some of the more fundamental concerns in writing a web application. Many will merely present security as a single chapter with a list of things to "check" to make sure your site is properly protected. Others will have a chapter covering strings, but not really address how you deal with people writing in foreign languages.
Core Web Application Development with PHP and MySQL doesn't just tell you how to use a particular technology such as sessions, XML, or file uploading--it discusses how they fit into the rest of your application, how they interact with other features, and how you use them in a safe and effective manner.
The other big problem I had were samples that seemed kind of contrived--e-commerce applications that left out key portions of the process or samples that were simply not something you're going to buy a book to help write at all. To solve this, I developed three full samples--an appointment/calendaring system, a blogging engine, and a poster store e-commerce system. With the full code included on a CD ROM (and updates available from the author's web site), you can actually play with completely working and usable web applications, debugging through them and fiddling with various features.
LP: What would you say sets this book apart from others?
Wandschneider: In addition to the samples and systematic approaches to topics critical to writing effective web applications, this book also shows programmers a lot of the tricks and traps hiding in the PHP language. I'm the kind of person who makes every single mistake possible, so I had a lot of experience in doing stupid things and was able to put a lot of that into this book, to hopefully help the reader avoid making those same mistakes.
I am also the kind of person who likes to understand how things work and why things are done. Without bogging down in pedantic details, I tried to justify and explain topics and technologies as I worked through them. Later on, you might not remember the exact details of the PHP function call or SQL Statement, but you might recall that this was something important enough to worry about and look it up again.
LP: Why do other books neglect these topics, do you think?
Wandschneider: I actually think that most other books do address these topics, but often in a disorganized way that gives them the feel of being tutorials crammed together into one big binding. A chapter on security that merely offers a simple list of things to check in your web server or php.ini don't adequately address the problem, nor does discussing programming without discussing all the ways in which things can (and inevitably do) go wrong.
LP: Why MySQL?
Wandschneider: I actually didn't want to write this book for only MySQL. While it is the database I use most frequently (strictly because it's the first I picked up and learned), the concepts in this book are not unique to that package. I had originally hoped to keep the book database server agnostic, but as I wrote more and more, I came to discover this was not possible, so I decided to focus on MySQL, and provide hints and tips to users of other DBMSes whenever possible (such as Appendix II: "Database Function Equivalents").
There is nothing in this book that should prevent the user from being able to develop web applications with other servers.
LP: Marc, what is your background?
Wandschneider: I got my degree in Computer Science from McGill University in Canada and moved to the United States to work for Microsoft in the mid-1990s. I spent most of my time there working on Visual Basic and various component technologies associated with it. In the end, I was the manager of the WinForms team for the .NET platform. I left in 1998 after increasing dissatisfaction with my job and the direction the company was going led to me to explore other opportunities.
Amusingly enough, in my early days at Microsoft, I found databases quite frustrating and aggravating to work with, and it wasn't until I began working with MySQL that I began to truly enjoy working with them again.
I have spent the last six years traveling the world, helping companies with various software development problems, and writing open source software in my spare time. I have lived in various countries such as Italy, Germany, and Japan, and have seen how mono-lingual web applications can be problematic for users.
LP: Microsoft? Aren't you worried that will reduce your credibility in the open source community?
Wandschneider: I've met some people who figure that since I worked for Microsoft, I must eat babies or something in my spare time. And yet, I maintain that my years at Microsoft were very valuable and rewarding. The company was still very much a fun place to work in the mid 1990s and I learned innumerable things about robust programming and truly testing and shipping effective software.
It is these good habits that I have tried to carry forward with me in my web application development. Everybody benefits when software is written well, and I hope to contribute more written open source.
LP: How long did it take to write the book?
Wandschneider: I went to a local café and started writing this book. Six months and many, many, many double espressos later, I had written the first draft of it, and it was off to editing (which took a few more months). I wasn't working at the time, so I was basically spending 40-50 hours a week writing it. I would spend a few days writing code and samples for a particular chapter or group of chapters, plan strategy for what I was going to write, and then I would actually begin typing it all up.
LP: Did you enjoy writing this book?
Wandschneider: There is nothing like trying to explain a particular concept or technology others to make sure you really understand how it works. I spent a lot of time writing little scripts and samples, and would sometimes sit there scratching my head, while at other times I would learn something completely new and interesting I had never known before. After a while you start dreaming in SQL and PHP. That's probably not the best thing to admit!
LP: What experience will readers of this book be expected to have?
Wandschneider: I wrote this book for people who have "programmed" before. I make no stronger requirement than that. If they have written a number of VB scripts or programs, written Perl for a while, or indeed written large applications in Java or C/C++, this book was designed to be accessible to the reader.
Since I knew next to nothing about databases before beginning to write web applications, I likewise assumed the reader would know little about those as well. With that in mind, the book sets out to teach the reader not only the syntax of PHP and SQL, but also the problems they will encounter, and how to use them most effectively in their applications.
LP: What platform do you think readers of this book should be using?
Wandschneider: There are absolutely no requirements on what the reader uses. I myself, to make sure that there was nothing too restrictive in what I was writing, developed, tested, and ran all samples on Windows, Linux, FreeBSD, and Mac OS X. I used PHP versions from PHP 5.0 to 5.0.4, as well as MySQL Versions from 4.1.7 and on (including the newest 5.0 releases).
I have recently worked on commercial PHP/MySQL web applications where development has occurred on Windows, Mac OS X, and servers running multiple flavors of Linux. In only the most extreme cases did we ever even notice that the versions were running on different platforms.
LP: What are the major features of PHP5 about which you're excited? What about MySQL?
Wandschneider: The object oriented features in PHP 5 are a very welcome addition to the language. I've found that it massively helps design of application and encourages clean organization of your code. The strict syntax checking has also proved helpful to avoid undefined variable errors, as well as numerous other little coding issues that have been hiding in my code. Add to that the new MySQLi (Improved MySQL) extension, and I've found programming PHP 5 to be a true joy.
MySQL has grown to be a truly interesting and robust database system. Versions greater than 4.1.7 have massively improved Unicode support, which has allowed me to develop applications that are completely ignorant of what language the user sends us data in. The database just stores them all as UTF-8 strings, and the application shuttles these data to the client. With a robust set of data types and the choice between MyISAM and InnoDB tables, there is a real sense of control when using this server.
LP: Where can users go for more help with this book?
Wandschneider: I maintain a blog at http://www.chipmunkninja.com, where I post not only updates and notes on this book, but also other tutorials and other things that developers might find useful.
Core Web Application Development with PHP and MySQL is organized into five core parts:
- learning PHP
- learning Databases
- designing your web applications
- implementing your web applications
- complete web application samples
With this progression through the topics, and systematic approach to design and security, the reader, whether they be inexperienced or advanced, will find this a valuable tool to have around as they explore the world of writing web applications. With a remarkable attention to detail, a light and easy writing style, and a complete explanation for how things work, you will absolutely love working through this text.
Title: Core Web Application Development with PHP and MySQL (Core) (Paperback)
Author: Marc Wandschneider
Publisher: Prentice Hall PTR; Bk&CD-Rom edition (September 26, 2005)
About the Author
Marc Wandschneider is a professional geek, graduating from McGill University in 1993 with a degree in Computer Science, during which time he was an extremely active member of the NetBSD development community. After six years at Microsoft in the mid-1990s, he left to travel, learn languages, and pursue more rewarding programming work.
In 2000, he wrote a clone of Outlook Express in Qt, and has spent the last 3-4 years focusing on web application development, most recently in AMP (Apache, PHP, and MySQL). He has just finished writing a book called "Core Web Application Programming with PHP and MySQL" for Prentice-Hall.
Much of this calendar year has been spent working on http://swik.net, an open source wiki-community written using AMP, and now incorporating large numbers of Ajax-like features to make it a much more dynamic system.
This article was first published on LinuxPlanet.com.