Head First PHP & MySQL
Head First PHP & MySQL by Lynn Beighley and Michael Morrison Copyright © 2009 O’Reilly Media, Inc. All rights reserved.
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Head First PHP & MySQL by Lynn Beighley and Michael Morrison Copyright © 2009 O’Reilly Media, Inc. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly Media books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected].
Michael’s nephew Julien generously lent his Superman powers to help get this book finished.
Printing History: December 2008: First Edition.
Drew is, at thi moment, installins very a new kitchen in g Lynn’s new old ho use.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. The Head First series designations, Head First PHP & MySQL, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and the authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. No hardwood floors, UFOs, Elvis look-alikes, or virtual guitars were harmed in the making of this book. But a few broken hearts were mended thanks to some careful mismatching!
7 building personalized web apps
Remember me? What’s your name again? Johnson, right. Well, I’m showing no record of you, Mr. Jackson. Are you sure you signed up for a warranty on your cryogenic storage cell? Oh, I see, so you’re calling from inside your cell right now. And what was your name again?
No one likes to be forgotten, especially users of web applications. If an application has any sense of “membership,” meaning that users somehow interact with the application in a personal way, then the application needs to remember the users. You’d hate to have to reintroduce yourself to your family every time you walk through the door at home. You don’t have to because they have this wonderful thing called memory. But web applications don’t remember people automatically—it’s up to a savvy web developer to use the tools at their disposal (PHP and MySQL, maybe?) to build personalized web apps that can actually remember users.
this is a new chapter 345
a good mismatch is hard to find
They say opposites attract It’s an age-old story: boy meets girl, girl thinks boy is completely nuts, boy thinks girl has issues, but their differences become the attraction, and they end up living happily ever after. This story drives the innovative new dating site, Mis-match.net. Mismatch takes the “opposites attract” theory to heart by mismatching people based on their differences.
Problem is, Mismatch has yet to get off the ground and is in dire need of a web developer to finish building the system. That’s where you come in. Millions of lonely hearts are anxiously awaiting your completion of the application. don’t let them down!
Sidney loves reality TV, yoga, and sushi, and is hoping for a successful mismatch.
I can’t wait to find my perfect mismatch.
Johan Nettles Male 1981-11-03 Athens, GA
Personal web applications thrive on personal information, which requires users to be able to access an application on a personal level.
Sidney Kelsow Female 1984-07-19 Tempe, AZ
Johan loves professional wrestling, weightlifting, and Spam, and is excited about anyone who’ll reply to him.
Mismatch users need to be able to interact with the site on a personal level. For one thing, this means they need personal profiles where they enter information about themselves that they can share with other Mismatch users, such as their gender, birthdate, and location. 346 Chapter 7
building personalized web apps
Mismatch is all about personal data So Mismatch is all about establishing connections through personal data. These connections must take place within a community of users, each of whom is able to interact with the site and manage their own personal data. A database called mismatch_user is used to keep up with Mismatch users and store their personal information.
This is the Mismatch database.
Head First PHP & MySQL: A Brain-Friendly Guide
If you’re ready to create web pages more complex than those you can build with HTML and CSS, Head First PHP & MySQL is the ultimate learning guide to building dynamic, database-driven websites using PHP and MySQL. Packed with real-world examples, this book teaches you all the essentials of server-side programming, from the fundamentals of PHP and MySQL coding to advanced topics such as form validation, session IDs, cookies, database queries and joins, file I/O operations, content management, and more.
Head First PHP & MySQL offers the same visually rich format that’s turned every title in the Head First series into a bestseller, with plenty of exercises, quizzes, puzzles, and other interactive features to help you retain what you’ve learned.
- Use PHP to transform static HTML pages into dynamic web sites
- Create and populate your own MySQL database tables, and work with data stored in files
- Perform sophisticated MySQL queries with joins, and refine your results with LIMIT and ORDER BY
- Use cookies and sessions to track visitors’ login information and personalize the site for users
- Protect your data from SQL injection attacks
- Use regular expressions to validate information on forms
- Dynamically display text based on session info and create images on the fly
- Pull syndicated data from other sites using PHP and XML
Throughout the book, you’ll build sophisticated examples — including a mailing list, a job board, and an online dating site — to help you learn how to harness the power of PHP and MySQL in a variety of contexts. If you’re ready to build a truly dynamic website, Head First PHP & MySQL is the ideal way to get going.
Head first PHP & MySQL
Publication date 2009 Topics MySQL (Electronic resource), PHP (Computer program language), Web site development Publisher Beijing ; Sebastopol, CA : O’Reilly Collection inlibrary; printdisabled; internetarchivebooks Digitizing sponsor The Arcadia Fund Contributor Internet Archive Language English
Notes
Cut-off text on some pages due text runs into the gutter.
Access-restricted-item true Addeddate 2021-07-27 14:01:03 Associated-names Morrison, Michael, 1970- Boxid IA40194107 Camera Sony Alpha-A6300 (Control) Collection_set printdisabled External-identifier urn:oclc:record:1153029238
urn:lcp:headfirstphpmysq0000beig:lcpdf:a108216e-97ef-4654-82c2-25d4535ee6be
urn:lcp:headfirstphpmysq0000beig:epub:1a406dc9-64d2-4c67-83f7-1a65013d10ea Foldoutcount 0 Grant_report Arcadia #4281 Identifier headfirstphpmysq0000beig Identifier-ark ark:/13960/t9q35zb75 Invoice 2089 Isbn 9780596006303
0596006306 Lccn 2009502160 Ocr tesseract 5.0.0-alpha-20201231-10-g1236 Ocr_detected_lang en Ocr_detected_lang_conf 1.0000 Ocr_detected_script Latin Ocr_detected_script_conf 0.9943 Ocr_module_version 0.0.13 Ocr_parameters -l eng Old_pallet IA-WL-2000053 Openlibrary_edition OL22869026M Openlibrary_work OL16992816W Page_number_confidence 94.39 Pages 822 Partner Innodata Pdf_module_version 0.0.15 Ppi 360 Rcs_key 24143 Republisher_date 20210727112844 Republisher_operator associate-evelyn-rabe@archive.org;associate-marycris-avenido@archive.org Republisher_time 678 Scandate 20210723104348 Scanner station12.cebu.archive.org Scanningcenter cebu Scribe3_search_catalog isbn Scribe3_search_id 9780596006303 Tts_version 4.5-initial-63-g7e8faad7
Pdf head first php and mysql
Авторы — Линн Бейли, Майкл Моррисон
Книга Линн Бейли и Майкла Моррисона «Изучаем PHP и MySQL» из серии «Head First» предназначена для тех, кто желает двигаться дальше создания простых НТМL-страниц, хочет изучить, понять и запомнить, как использовать РНР и MySQL для разработки веб-приложений. Книги данной серии отличаются простотой изложения, многочисленными примерами и использованием большого количества иллюстраций. Эту книгу можно назвать учебным пособием, но справочником она не является. Начинается книга с изучения простых проrраммных решений и основных приемов работ с базами данных. Затем рассматриваются более сложные функции РНР и запросы MySQL, а в самом конце описывается решение наиболее сложных задач. Хотя очень важно создавать приложения, которые позволяют пользователям добавлять в него данные и извлекать их, однако прежде чем вы сможете делать это, вам необходимо разобраться с синтаксисом и РНР, и MySQL. Поэтому в книге даются выражения РНР и MySQL, которые вы можете проверить на практике.
В книге не рассматриваются ВСЕ выражения, функции, ключевые слова и запросы РНР и MySQL. Эту информацию вы сможете найти в соответствующих справочниках. Описываются лишь те из них, которые вам необходимо знать и которые вы будете использовать в 95% времени.
Материал книги основан на использовании РНР версий 5 или 6 и MySQL версий 5 или 6.