This tutorial does not want you to fully understand this language, but allows you to join the development of dynamic web sites as soon as possible. I suppose you have some basic HTML (or HTML editor) knowledge and some programming ideas.
Introduction
PHP is one of the tools that allow you to generate dynamic web pages. PHP stands for Hypertext Preprocessor (PHP: Hypertext Preprocessor ). PHP is completely free and free to spend, you can download from PhP official site (http://www.php.net) freely. PHP complies with the GNU Public License (GPL), under which many popular software such as Linux and Emacs are born. You can obtain the source code without restrictions, or even add the features you need. PHP can run on most Unix platforms, gun, Linux, and Microsoft Windows. Information on how to install PHP on a Windows PC or Unix server can be found at the official site of PHP, or you can refer to the topic "PHP installation full attack backup" on taoba. Article . The installation process is simple.
If your machine solves the 2000 problem, PHP will not have any problems!
History
Three years ago, Rasmus lerdorf created "personal home page Tools" to create his online resume ). This is a very simple language. More and more people have noticed this language and put forward various suggestions for its extension. With the selfless dedication of many people and the language itself Source code It is a language with rich features and is still growing.
Although PHP is easy to learn, it is slower than mod_perl (the Perl module implanted into Web servers. Now we have a new Zend engine that can rival the speed of mod_perl, and PhP4 can make full use of it. Now, the official version of PhP4 has been released. You can download it on the official site of PHP. 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.
PHP applications have grown significantly in personal web projects. According to Netcraft's report in October 1999, 931122 domains and 321128 IP addresses use PHP Technology.
Advanced PHP
PHP has many advantages. Of course, it is known that PHP is an open-source project with no commercial support, and the resulting execution speed is slow (until PhP4 ). However, the PHP mail list is very useful unless you are running like Yahoo! Or a very popular site Like Amazon.com, you don't feel the PHP speed is different from other websites. At least I don'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 documents to learn how to write a sample. Program . You only need to know some basic syntaxes and language features to start your PHP coding journey. If you encounter any problems during the coding process, you can also read the relevant documents.
PHP syntax is similar to C, Perl, ASP or JSP. For those who are familiar with one of the above languages, PHP is too simple. On the contrary, if you know more about PhP, you can easily learn other languages.
You only need 30 minutes to master all the features of PHP's core language. You may have a good understanding of HTML, you even know how to use the editing and design software or manually create a good-looking web site. Because PHP Code You can easily add your site to PhP to make your site more dynamic while designing and maintaining the site.
Database Connection
PHP can be compiled into functions connected to many databases. PHP and MySQL are a perfect combination. You can also write peripheral functions to indirectly access the database. In this way, when you change the database you are using, you can easily change the encoding to adapt to this change. Phplib is the most commonly used base database to provide general transactions.
Scalability
As mentioned above, PHP has entered a period of rapid development. It may be difficult for a non-programmer to extend additional functions for PHP, but it is not difficult for a PHP programmer.
Object-Oriented Programming
PHP provides classes and objects. Web-based programming requires Object-Oriented Programming capabilities. PHP supports constructors and extraction classes.
Scalability
Traditionally, the interaction of web pages is achieved through CGI. The CGI program is not ideal for scalability because it opens an independent process for every running CGI program. The solution is to compile the interpreter that is often used to write CGI programs into your web server (such as mod_perl and JSP ). PHP can be installed in this way, although few prefer to install it in CGI Mode. Embedded PHP can have higher scalability.
More features
PHP developers have developed many popular peripheral base libraries to better suit web programming. These libraries contain a more easy-to-use layer. You can use PHP to connect to most databases, including Oracle, MS-access, and MySQL. You can draw pictures on flies, write programs to download or display e-mail. You can even complete network-related functions. The best thing is, you can select the features required for your PHP installation version. The reference to Nissan's Xterra is that PHP can do everything you want and do everything you want!
MySQL Introduction
MySQL is widely used in Linux Community People love semi-commercial databases. MySQL can run on most Linux platforms (i386, iSCSI, etc), as well as a few non-Linux or even non-UNIX platforms.
License fee
The popularity of MySQL is largely due to its loose, except for a slightly unusual licensing fee. The price of MySQL varies with the platform and installation method. MySQL Windows versions (NT and 9x) are not free of charge under any circumstances, and any unix variant (including Linux) mySQL is free of charge if it is installed by the user or the system administrator instead of a third party, and the third solution is required to pay the license fee.
Price
Platform Installation price
Windows NT, 9x any $200
Free installation for Unix or Linux
$200 for third-party installation in Unix or Linux
$200 for an application component
You can get a variety of support contracts with too much content to be listed. You can consult the MySQL site for the latest offer.
3. Installation
Most major software package formats (rpm, DBE, and tgz) can be obtained on the MySQL site. The client library and various languages "wrapper" can be obtained in separate RPM formats. The RPM format does not require much trouble and requires no initial configuration. The rc3.d (RedHat RPM is used as an example) generates an initial script. Therefore, the MySQL daemon is started to run when it is restarted in multi-user mode. MySQL daemon (mysqld) consumes a small amount of memory (on the Pentium 5.1 running RedHat 133, each daemon uses KB of memory and 4 MB of shared memory) mySQL can be loaded to the processor only when real queries are executed, which means that MySQL can be easily used for small databases without affecting other system functions.
Data Type
It is a good thing that fields support a large number of data types. Generally, integers, floating-point numbers, strings, and numbers are expressed in multiple lengths, and long blob (Binary Large Object) types are supported. The automatic increment option can also be used to represent integer fields.
Unlike most other database systems, MySQL provides two relatively uncommon field types: Enum and set. Enum is an enumeration type. It is very suitable for an enumeration type in PASCAL language. It allows programmers to see field values similar to 'Red, 'green', and 'Blue, mySQL only stores these values as one byte. Set is also borrowed from pascal. It is also an enumeration type, but a single field can store multiple values at a time, this ability to store multiple enumerated values may not give you some impression (and may threaten the definition of the third paradigm), but correct use of the set and contains keywords can save a lot of table connections, it can achieve good performance improvement.
5. SQL compatibility
MySQL contains some different transformations from SQL standards. Most of them are designed as a compensation for the lack of SQL scripting language. However, other extensions make MySQL different. For example, link clause search automatically ignores case sensitivity. MySQL also allows users to customize SQL functions. In other words, a programmer can write a function and integrate it into mysql. what it represents with any basic functions such as sum () or AVG () there is no difference. The function must be compiled into a shared library file (. So file) and loaded with a load function command.
It also lacks some common SQL functions and has no sub-selection (query in the query ). The view is gone. Of course, most subqueries can be rewritten using simple join clauses, but sometimes it is easier to think about problems with two nested queries than a large join. Similarly, the view only hides the WHERE clause for programmers, but this is another convenience that programmers expect.
Stored Procedures and triggers
MySQL does not have a stored procedure language, which is the biggest restriction on programmers who are used to enterprise-level databases. Multi-statement SQL commands must be coordinated by the client code. In this case, multi-statement execution is allowed only by means of a sound Query Language and the ability to lock and unlock tables on the client.
7. referential integrity-ri)
One of the major defects of MySQL is the lack of a standard Ri mechanism. However, MySQL creators do not ignore their users' desires and provide some solutions. One of them is the support for unique indexes. The lack of rule restrictions (a fixed range limit on the given field) is compensated by a large number of data types. It does not simply provide check constraints (limits on the value of one field relative to another field in the same row), external keywords, and frequently ri-related "Cascading deletion" functions. Interestingly, when these functions are not supported, the SQL analyzer tolerates the syntax of these statements. This is intended to facilitate the migration of databases to MySQL. This is a good attempt, and it does leave a convenient way to support this function in the future. However, those who have not carefully read the document may mistakenly think that these functions actually exist.
7. Security
From beginning to end, my biggest complaint about MySQL was its security system. Its only drawback was its complexity and non-standard. In addition, it only changed when I called mysqladmin to re-read user permissions. Generally, SQL grant/Revoke statements are only supported in the latest version, but at least they have them now. MySQL writers widely record their specific security systems, but it does need a learning process that may be useless.
Apache + PHP + MySQL is the best combination and also the best combination of enterprise networks,
If you want to learn PHP, you can find a lot of tutorials on the Internet. In fact, the best thing to learn about any program is to write and keep reading.
Of course, the best website is Dreamweaver, which can write a lot of code and design it!