1. Trang chủ
  2. » Giáo án - Bài giảng

Learning PHP & My SQL (Step by step)

430 540 0

Đ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

Thông tin cơ bản

Định dạng
Số trang 430
Dung lượng 6,25 MB

Nội dung

[...]... 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

TỪ KHÓA LIÊN QUAN

w