PHP and MySQL for Dummies (ISBN - 0764555898)

by Janet Valade PHP & MySQL FOR DUMmIES ‰ 2ND EDITION PHP & MySQL FOR DUMmIES ‰ 2ND EDITION by Jane - pdf za darmo

10 downloads 5754 Views 4MB Size

Story Transcript


PHP & MySQL



FOR

DUMmIES



2ND

EDITION

by Janet Valade

PHP & MySQL



FOR

DUMmIES



2ND

EDITION

PHP & MySQL



FOR

DUMmIES



2ND

EDITION

by Janet Valade

PHP & MySQL For Dummies®, 2nd Edition Published by Wiley Publishing, Inc. 111 River Street Hoboken, NJ 07030-5774 Copyright © 2004 by Wiley Publishing, Inc., Indianapolis, Indiana Published by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4447, e-mail: [email protected]

Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at 800-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Control Number: 2004101961 ISBN: 0-7645-5589-8 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 2B/SU/QT/QU/IN

About the Author Janet Valade is the author of PHP 5 For Dummies as well as the first edition of this book. In addition, Janet has authored and revised chapters for Linux books, written chapters for a Certified Internet Webmaster (CIW) book, and written the Apache section for a book on LAMP (Linux, Apache, MySQL, and PHP). Janet has 20 years of experience in the computing field. Most recently, she worked as a Web designer and programmer in a Unix/Linux environment for four years. Prior to that, Janet worked for 13 years in a university environment, where she was a systems analyst. During her tenure, she supervised the installation and operation of computing resources, designed and developed a data archive, supported faculty and students in their computer usage, wrote numerous technical papers, and developed and presented seminars on a variety of technology topics. To keep in touch, see janet.valade.com.

Author’s Acknowledgments First, I wish to express my appreciation to the entire open source community. Without those who give their time and talent, there would be no cool PHP and MySQL for me to write about. Furthermore, I never would have learned this software without the lists where people generously spend their time answering foolish questions from beginners. I want to thank my mother for passing on a writing gene, along with many other things. And my children always for everything. My thanks to my friends Art, Dick, and Marge for responding to my last-minute call for help. I particularly want to thank Sammy, Dude, Spike, Lucky, Upanishad, Sadie, and E.B. for their important contributions. And, of course, I want to thank the professionals who make it all possible. Without my agent and the people at Wiley Publishing, Inc., this book would not exist. Because they all do their jobs so well, I can contribute my part to this joint project.

Publisher’s Acknowledgments We’re proud of this book; please send us your comments through our online registration form located at www.dummies.com/register/. Some of the people who helped bring this book to market include the following: Acquisitions, Editorial, and Media Development

Production

Senior Project Editor: Pat O’Brien Acquisitions Editor: Terri Varveris Senior Copy Editor: Teresa Artman

Project Coordinator: Maridee Ennis Layout and Graphics: Andrea Dahl, Joyce Haughey, Stephanie D. Jumper, Kristin McMullan, Lynsey Osborn

Editorial Manager: Kevin Kirschner

Proofreaders: Andy Hollandbeck, Carl William Pierce, Brian H. Walls, TECHBOOKS Publishing Services

Permissions Editor: Laura Moss

Indexer: TECHBOOKS Publishing Services

Technical Editor: Craig Lukasik

Media Development Specialist: Kit Malone Media Development Manager: Laura VanWinkle Media Development Supervisor: Richard Graves Editorial Assistant: Amanda Foxworth Cartoons: Rich Tennant, www.the5thwave.com

Publishing and Editorial for Technology Dummies Richard Swadley, Vice President and Executive Group Publisher Andy Cummings, Vice President and Publisher Mary C. Corder, Editorial Director Publishing for Consumer Dummies Diane Graves Steele, Vice President and Publisher Joyce Pepple, Acquisitions Director Composition Services Gerry Fahey, Vice President of Production Services Debbie Stailey, Director of Composition Services

Contents at a Glance Introduction .................................................................1 Part I: Developing a Web Database Application Using PHP and MySQL ................................................7 Chapter 1: Introduction to PHP and MySQL ..................................................................9 Chapter 2: Setting Up Your Work Environment ...........................................................21 Chapter 3: Developing a Web Database Application ..................................................37

Part II: MySQL Database ...........................................63 Chapter 4: Building the Database ..................................................................................65 Chapter 5: Protecting Your Data ....................................................................................93

Part III: PHP ...........................................................113 Chapter 6: General PHP ................................................................................................115 Chapter 7: PHP Building Blocks for Programs ...........................................................145 Chapter 8: Data In, Data Out ........................................................................................189 Chapter 9: Moving Information from One Web Page to the Next ............................257

Part IV: Applications ...............................................279 Chapter 10: Putting It All Together ..............................................................................281 Chapter 11: Building an Online Catalog ......................................................................293 Chapter 12: Building a Members Only Web Site ........................................................331

Part V: The Part of Tens ...........................................361 Chapter 13: Ten Things You Might Want to Do Using PHP Functions ....................363 Chapter 14: Ten PHP Gotchas ......................................................................................371

Part VI: Appendixes .................................................377 Appendix A: Installing MySQL .....................................................................................379 Appendix B: Installing PHP ...........................................................................................395 Appendix C: Installing and Configuring Apache ........................................................409

Index .......................................................................421

Table of Contents Introduction..................................................................1 About This Book ..............................................................................................1 Conventions Used in This Book ....................................................................2 What You’re Not to Read ................................................................................3 Foolish Assumptions ......................................................................................3 How This Book Is Organized ..........................................................................4 Part I: Developing a Web Database...

Life Enjoy

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

Social

© Copyright 2016 - 2019 AZPDF.PL - All rights reserved.