Learning PHP & My SQL (Step by step)

430 540 0
Learning PHP & My SQL (Step by step)

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... Using PHP with MySQL There are several factors that make using PHP and MySQL together a natural choice: PHP and MySQL work well together PHP and MySQL have been developed with each other in mind, so they are easy to use together The programming interfaces between them are logically paired up Working together wasn’t an afterthought when the developers created the PHP and MySQL interfaces PHP and MySQL... purchase professional support for MySQL if you need it PHP and MySQL are fast Their simple and efficient designs enable faster processing PHP and MySQL don’t bog you down with unnecessary details You don’t need to know all of the low-level details of how the PHP language interfaces with the MySQL database, as there is a standard interface for calling MySQL procedures from PHP Online application programming... information intelligently The original core MySQL developers were trying to solve their needs for a database by using mSQL, a small and simple database It become clear that mSQL couldn’t solve all the problems they wanted it to, so they created a more robust database that turned into MySQL MySQL supports several different database engines Database engines determine how MySQL handles the actual storage and querying... comment // As a security measure, escape any special characters in the user_name $comment=mysql_real_escape_string($comment); // This is the SQL command $sql_ insert = "INSERT INTO `comments` (body) VALUES ('$comment')"; // Select the database mysql_select_db($database); $success = mysql_query( $sql_ insert) or die(mysql_error( )); // print the page header print(' Remove User... web server detects that the PHP file isn’t just a plain HTML file, so it asks another process—the PHP interpreter—to process the file 6 The PHP interpreter executes the PHP code that it finds in the text it received from the web server process Included in that code are calls to the MySQL database 7 PHP asks the MySQL database process to execute the database calls 8 The MySQL database process returns... CSS, PHP templates, and a MySQL database all at once PHP templates make it easier to Integrating Many Sources of Information | 7 change the HTML in a page when it contains fields populated by a database query We’ll take a quick look at how these pieces come together Just to give you a taste of what your code will look like, Example 1-1 shows MySQL code called from PHP for inserting a comment into a MySQL... interfaces PHP and MySQL have open source power As they are both open source projects, PHP and MySQL can both be used for free MySQL client libraries are no longer bundled with PHP Advanced users have the ability to make changes to the source code, and therefore change the way the language and programs work PHP and MySQL have community support Both tools active communities on the Web in which you can... Apache • PHP • MySQL You need to install the programs in that order All our examples will be from the installation perspective of a PC with Windows installed, with notes for Macintosh and Linux systems 15 The easiest way to install Apache, PHP, and MySQL on most Linux systems is to download a packaged distribution All popular Linux distributions have prebuilt packages from Apache, PHP, and MySQL For... instructions for installing additional packages Many Linux distributions install Apache, PHP, and MySQL by default, so you may not even need to install them If this looks too daunting, try XAMPP Bundled or Full Installations When just starting out, it can be easier to install a bundled set of Apache, MySQL, phpMyAdmin, and PHP There are several packages available that install all of these at the same time... contained within the PHP framework This means that there’s no reason for you to reinvent the wheel each time you sit down to develop a PHP program; it comes with web functionality built-in While PHP is great for web application development, it doesn’t store information by itself For that, you need a database The database of choice for PHP developers is MySQL, which acts like a filing clerk for PHP- processed . Learning PHP and MySQL Other resources from O’Reilly Related titles Essential PHP Security Learning PHP 5 Learning MySQL Mastering Regular Expressions MySQL Cookbook ™ MySQL in a Nutshell MySQL. and Linux. PHP and MySQL’s Place in Web Development | 3 Advantages of Using PHP with MySQL There are several factors that make using PHP and MySQL together a natural choice: PHP and MySQL work. developers created the PHP and MySQL interfaces. PHP and MySQL have open source power As they are both open source projects, PHP and MySQL can both be used for free. MySQL client libraries are

Ngày đăng: 21/05/2015, 13:00

Mục lục

  • Learning PHP and MySQL, Second Edition

    • Table of Contents

    • Assumptions This Book Makes

    • Organization of This Book

    • Conventions Used in This Book

    • How to Contact Us

    • Dynamic Content and the Web

      • HTTP and the Internet

      • PHP and MySQL’s Place in Web Development

        • Advantages of Using PHP with MySQL

        • The Value of Open Source

        • The Components of a PHP Application

          • PHP

          • SQL and Relational Databases

          • Integrating Many Sources of Information

          • Requesting Data from a Web Page

          • Installation

            • Developing Locally

              • Bundled or Full Installations

              • Installing PHP

                • Enabling PHP on Mac OS X

                • Installing MySQL 5.0

                  • Installing the MySQL Connector

                  • Mac OS X MySQL installation

                  • Exploring PHP

                    • PHP and HTML Text

                      • Text Output

                        • Separating PHP from HTML

                        • Coding Building Blocks

                          • Variables

                            • Reading a variable’s value

                            • Strings

                              • Special characters in strings

                              • Operator Concepts

                                • Number of Operands

Tài liệu cùng người dùng

Tài liệu liên quan