PHP and PHP MySQL Relationship _php Tutorial

Source: Internet
Author: User
Tags learn php php and mysql php mysql
This tutorial does not want you to fully understand the language, but it will allow you to join the development of dynamic Web sites as soon as possible. I assume you have some basic knowledge of HTML (or HTML editor) and some programming ideas.
Brief introduction
PHP is one of the tools that allows you to generate dynamic Web pages. PHP representative: Hypertext Preprocessor (Php:hypertext preprocessor). PHP is completely free of charge and you can download it freely from the official PHP site (http://www.php.net). PHP complies with the GNU Public License (GPL), under which many popular software such as Linux and Emacs have been created. You can gain unlimited access to the source code and even add the features you need. PHP works on most Unix platforms, Gun/linux and Microsoft Windows platforms. How to install PHP on a PC or UNIX machine on a Windows environment can be found on the official PHP site, or you can check out the "PHP installation All-in-all" feature article in the Web page Pottery bar. The installation process is simple.
If your machine solves 2000 problems, then PHP does not have the millennium bug problem!
History
Three years ago, Rasmus Lerdorf created a personal page tool to create his online CV (Personal home page tools). This is a very simple language. A growing number of people subsequently took note of the language and made various suggestions for its expansion. In the selfless devotion of many people and the free nature of the source code of the language itself, it has evolved into a rich language and is now growing.
Although PHP is easy to learn, it is slower than Mod_perl (the Perl module that implants the Web server). Now with a new engine called Zend that can rival mod_perl speed, PHP4 can take advantage of the engine. Now, the official version of PHP4 has been released, you can go to the official PHP site to download. Andy Gutmans and Zeev Suraki are the main authors of Zend. You can go to the Zend site (http://www.zend.com) to learn more.
The application of PHP has grown significantly in the personal Web project. According to Netcraft's report in October 1999, there are 931,122 domains and 321,128 IP addresses using PHP technology.
The advanced point of PHP
There are many benefits to applying PHP. Of course, the disadvantage is that PHP is not commercially supported because it is an open source project, and the resulting execution speed is slow (until PHP4). But PHP's mailing lists are very useful and unless you're running a popular site like Yahoo! or Amazon.com, you won't feel the speed of PHP being any different. At least I didn't feel it! Well, let's take a look at the advantages of PHP:
Learning process
I personally prefer PHP's very simple learning process. Unlike Java and Perl, you don't have to bury your head in more than 100 pages of documentation to learn how to write a decent program. As long as you know some basic grammar and language features, you can start your PHP coding journey. You can then go through the documentation if you are having trouble with the coding process.
PHP's syntax is similar to c,perl,asp or JSP. For those who are more familiar with one of these languages, PHP is too simple. Conversely, if you know more about PHP, you will be very easy to learn from several other languages.
You can get all the core language features of PHP in just 30 minutes, you probably already know the HTML very well, and you've even learned how to create a good-looking Web site with an editorial design software or by hand. Because PHP code can be easily added to your site, while you design and maintain the site, you can easy to join PHP to make your site more dynamic features.
Database connection
PHP can be compiled into functions that are connected to many databases. PHP and MySQL are now a great combination. You can also write your own peripheral functions to access the database indirectly. With this approach, you can easily change the encoding to accommodate such changes when you replace the database you are using. Phplib is the most common set of base libraries that can provide general transaction needs.
Scalability
As I said earlier, PHP has entered a period of rapid development. It may be difficult for a non-programmer to extend additional functionality to PHP, but it is not difficult for a PHP programmer.
Object-Oriented Programming
PHP provides classes and objects. Web-based programming requires an object-oriented programming capability. PHP supports constructors, extraction classes, and so on.
Scalability
Traditionally, the interaction of Web pages is achieved through CGI. The CGI program's scalability is not ideal because it opens a separate process for each of the running CGI programs. The solution is to compile the interpreter for the language that is often used to write CGI programs into your Web server (such as mod_perl,jsp). PHP can be installed in this way, although few would like to install it in a CGI manner. Built-in PHP can be more scalable.
More Features
PHP developers have developed many of the most popular base libraries for Web programming, which contain easier-to-use layers. You can use PHP to connect most databases, including Oracle,ms-access,mysql. You can draw pictures on flies, write programs to download or display e-mails. You can even complete network-related functions. Best of all, you can choose which features you need for your PHP installation. Quoting Nissan's Xterra, PHP can do everything you want it to do and be omnipotent!

About MySQL
MySQL is a semi-commercial database that is popular with people in the Linux community. MySQL is available to run on most Linux platforms (I386,SPARC,ETC), as well as a little non-Linux or even non-UNIX platform.
License fee
The popularity of MySQL largely stems from its easing, in addition to slightly unusual licensing fees. The price of MySQL varies with the platform and installation mode. MySQL's version of Windows (NT and 9X) is not free in any case, and any UNIX variant (including Linux) is free if installed by the user himself or by a system administrator instead of a third party, and the third program village must pay the license fee.
Price
Platform Installation method Price
Windows nt,9x any $200
Unix or Linux self-installing free
Unix or Linux third-party installation $200
Need an application component $200
Can get a variety of support contracts, too much content is no longer listed, the latest price can be consulted MySQL site.
3. Installation
Most major package formats (RPM, DBE, TGZ) can be obtained on the MySQL site, and the client library and various language "wrappers" (Wrapper) can be obtained in separate RPM formats. The RPM format is not much more annoying and requires no initial configuration. In Rc3.d (take redhat rpm as an example), an initial script is generated, so the MySQL daemon is started when it restarts in multi-user mode. The MySQL daemon (mysqld) consumes very little memory (on Pentium 133 running Redhat 5.1, each daemon uses 500K of memory and an additional 4 m of shared memory) and mounts to the processor only when a real query is executed, which means that for small databases, MySQL can be fairly easy to use without having much impact on other system functions.
Data type
A field that supports a large number of data types is a good thing. The usual integers, floating-point numbers, strings, and numbers are represented in a variety of lengths and support the variable-length blob (Binary Large OBject) type. The integer field is also represented by the AutoIncrement option, and DateTime fields.
Unlike most other database systems, MySQL provides two relatively infrequently used field types: Enum and set. An enum is an enumeration type that is very class-appropriate for the Pascal language, which allows programmers to see field values similar to ' Red, ' green ', and ' blue ', while MySQL stores only those values as one byte. Set is also borrowed from Pascal, which is also an enumeration type, but a single field can store multiple values at a time, and the ability to store multiple enumeration values may not give you some impression (and may threaten the definition of the third paradigm), but using the set and contains keywords correctly saves many table connections. Can achieve a good performance improvement.
5. SQL compatibility
MySQL contains a number of different changes from the SQL standard, and most of them are designed to compensate for the inadequacy of the SQL language scripting language. However, other extensions do make MySQL unique, for example, the link clause search is automatically ignoring case. MySQL also allows user-defined SQL functions, in other words, a programmer can write a function and then integrate it into MySQL, and it behaves differently than any basic function such as SUM () or AVG (). The function must be compiled into a shared library file (. so file) and then loaded with a load function command.
It also lacks some common SQL features, and there are no sub-selections (queries in queries). The view is gone, too. Of course most subqueries can be rewritten with a simple join clause, but sometimes it is easier to think of a problem with two nested queries than a large connection. Similarly, the view is just a hidden where clause for programmers, but this is another convenience that programmers expect.
Stored procedures and triggers
MySQL does not have a stored procedure (Stored Procedure) language, which is the biggest limitation for programmers accustomed to enterprise-grade databases. Multi-statement SQL commands must be reconciled by client-side code, which allows multiple statements to run with the help of a fairly robust query language and the ability to lock and unlock tables to the client.
7. Referential integrity (referential Integrity-ri)
One of the main drawbacks of MySQL is the lack of a standard RI mechanism; however, the creator of MySQL is not deaf to the wishes of its users and offers some solutions. One of them is to support unique indexes. The lack of rule restrictions (a fixed range limit on the field of a given spike) is compensated by a large number of data types. does not simply provide a check constraint (the limit of one field's value relative to another field in the same row), an external keyword, and the cascade Delete feature that is frequently associated with RIS. Interestingly, when these features are not supported, the SQL parser tolerates the syntax of these statements. This is done to easily migrate the database into MySQL. This is a good attempt, and it certainly leaves the door for future support; However, those who do not read the document carefully may mistakenly assume that these features actually exist.
7. Security
My biggest complaint to MySQL from start to finish is its security system, whose only drawback is its complexity, not the standard, and changes only when it calls Mysqladmin to reread the user's permissions. The usual SQL Grant/revoke statements are supported by the most recent version, but at least they are now available. MySQL writers have widely documented their specific security systems, but they do need a learning process that may be no other way.

Apache+php+mysql is the best collocation, is also the best collocation with the Enterprise network,

If you learn PHP, then you can find a lot of tutorials in the network, in fact, the best way to learn any program is to write, keep on reading.

Of course the best is Dreamweaver, it can write a lot of code, can also be designed!

http://www.bkjia.com/PHPjc/320284.html www.bkjia.com true http://www.bkjia.com/PHPjc/320284.html techarticle This tutorial does not want you to fully understand the language, but it will allow you to join the development of dynamic Web sites as soon as possible. I assume you have some basic knowledge of HTML (or HTML editor) and some ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.