Head First PHP & MySQL
Lynn Beighley
Michael Morrison
Beijing Cambridge Farnham Kln Sebastopol Tokyo
For my parents, who frequently use web applications and are always there for me.
Lynn Beighley
To Rasmus Lerdorf, who single-handedly sparked the language that would eventually become PHP as we know it now. Enduring proof that it really only takes one person to lead us all down a new, more enlightened path.
Michael Morrison
Special Upgrade Offer
If you purchased this ebook directly from oreilly.com, you have the following benefits:
DRM-free ebooksuse your ebooks across devices without restrictions or limitations
Multiple formatsuse on your laptop, tablet, or phone
Lifetime access, with free updates
Dropbox syncingyour files, anywhere
If you purchased this ebook from another retailer, you can upgrade your ebook to take advantage of all these benefits for just $4.99. to access your ebook upgrade.
Please note that upgrade offers are not available from sample content.
A Note Regarding Supplemental Files
Supplemental files and examples for this book can be found at http://examples.oreilly.com/9780596006303/. Please use a standard desktop web browser to access these files, as they may not be accessible from all ereader devices.
All code files or examples referenced in the book will be available online. For physical books that ship with an accompanying disc, whenever possible, weve posted all CD/DVD content. Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to .
Advance Praise for Head First PHP & MySQL
PHP and MySQL are two of todays most popular web development technologies, and this book shows readers why. Building a site without them is now as unthinkable as doing web design without CSS. This book is a great introduction and is laugh-out-loud funny. Its the book I wish I had learned from.
Harvey Quamen, Associate Professor of English and Humanities Computing, University of Alberta
Everything weve come to accept about the drudgery of technical learning has been abandoned and in its place an unusually fun method for learning is created. I have full confidence that the Head First series will revolutionize the technical publishing industry, and that these new methods will be the eventual standard. I bet my tech-phobic grandmother could pick up PHP and MySQL techniques after a single reading. Shed probably even have a good time doing it!
Will Harris, Database Administrator, Powered By Geek
Reading Head First PHP & MySQL is like taking a class from the cool teacher. It makes you look forward to learning.
Stephanie Liese, Web Developer
Using images and humor the book is easy to digest and yet delivers real technical know-how.
Jereme Allen, Web Developer
After a challenging, high-speed read-through and lots of quirky Do This projects, such as My dog was abducted by aliens and the Mismatch Dating Agency, I cant wait to add some real PHP power to my web sites.
David Briggs, Software Engineer and Technical Author
Praise for Head First HTML with CSS & XHTML
Eric and Elisabeth Freeman clearly know their stuff. As the Internet becomes more complex, inspired construction of web pages becomes increasingly critical. Elegant design is at the core of every chapter here, each concept conveyed with equal doses of pragmatism and wit.
Ken Goldstein, Executive Vice President & Managing Director, Disney Online
The Web would be a much better place if every HTML author started off by reading this book.
L. David Baron, Technical Lead, Layout & CSS, Mozilla Corporation, http://dbaron.org/
Ive been writing HTML and CSS for ten years now, and what used to be a long trial and error learning process has now been reduced neatly into an engaging paperback. HTML used to be something you could just hack away at until things looked okay on screen, but with the advent of web standards and the movement towards accessibility, sloppy coding practice is not acceptable anymore... from a business standpoint or a social responsibility standpoint. Head First HTML with CSS & XHTML teaches you how to do things right from the beginning without making the whole process seem overwhelming. HTML, when properly explained, is no more complicated than plain English, and the Freemans do an excellent job of keeping every concept at eye-level.
Mike Davidson, President & CEO, Newsvine, Inc.
Oh, great. You made an XHTML book simple enough a CEO can understand it. What will you do next? Accounting simple enough my developer can understand it? Next thing you know well be collaborating as a team or something.
Janice Fraser, CEO, Adaptive Path
This book has humor, and charm, but most importantly, it has heart. I know that sounds ridiculous to say about a technical book, but I really sense that at its core, this book (or at least its authors) really care that the reader learn the material. This comes across in the style, the language, and the techniques. Learning real understanding and comprehension on the part of the reader is clearly top most in the minds of the Freemans. And thank you, thank you, thank you, for the books strong, and sensible advocacy of standards compliance. Its great to see an entry level book, that I think will be widely read and studied, campaign so eloquently and persuasively on behalf of the value of standards compliance in web page code. I even found in here a few great arguments I had not thought of ones I can remember and use when I am asked as I still am whats the deal with compliance and why should we care? Ill have more ammo now! I also liked that the book sprinkles in some basics about the mechanics of actually getting a web page live - FTP, web server basics, file structures, etc.
Robert Neer, Director of Product Development, Movies.com
Praise for Head First JavaScript
So practical and useful, and so well explained. This book does a great job of introducing a complete newbie to JavaScript, and its another testament to Head Firsts teaching style. Out of the other JavaScript books, Head First JavaScript is great for learning, compared to other reference books the size of a phone book.
Alex Lee, Student, University of Houston
An excellent choice for the beginning JavaScript developer.
Fletcher Moore, Web Developer & Designer, Georgia Institute of Technology
Yet another great book in the classic Head First style.
TW Scannell
JavaScript has long been the client-side engine that drives pages on the Web, but it has also long been misunderstood and misused. With Head First JavaScript , Michael Morrison gives a straightforward and easy-to-understand introduction of this language, removing any misunderstanding that ever existed and showing how to most effectively use it to enhance your web pages.
Anthony T. Holdener III, Web applications developer, and the author of Ajax: The Definitive Guide .
A web page has three partscontent (HTML), appearance (CSS), and behaviour (JavaScript).