Current location - Education and Training Encyclopedia - Resume - What's the extension? PHP?
What's the extension? PHP?
PHP is a server-side scripting language that is easy to learn and use. With little programming knowledge, you can build a truly interactive website using PHP. This tutorial doesn't want you to fully understand this language, but it can help you join the ranks of developing dynamic websites as soon as possible. I assume that 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 stands for Hypertext Preprocessor (PHP). PHP is completely free and costs nothing. You can learn more from the official website of PHP ().

The application of PHP in personal web projects has increased significantly. According to Netcraft's report in 1999 10, there are 93 1 122 domains and 32 1 128 IP addresses using PHP technology.

Advantages of PHP

There are many advantages to using PHP. Of course, the known disadvantage is that PHP, as an open source project, has no commercial support and its execution speed is slow (until PHP4). But PHP mailing lists are very useful unless you are running something like Yahoo! Or a very popular website like Amazon.com, you won't feel that the speed of PHP is different. At least I didn't feel it! Ok, let's see what advantages PHP has:

learning process

Personally, I prefer the very simple learning process of PHP. Unlike Java and Perl, you don't have to bury yourself in 100 pages of documents to learn to write a decent program. As long as you know some basic grammar and language features, you can start your PHP coding journey. After that, if you have any trouble in the coding process, you can browse the relevant documents again.

The syntax of PHP is similar to C, Perl, ASP or JSP. PHP is too simple for people who are familiar with one of the above languages. On the contrary, if you know more about PHP, you can easily learn several other languages.

It only takes you 30 minutes to master all the core language features of PHP. You may already know HTML very well, and even you already know how to make beautiful websites by editing and designing software or by hand. Because PHP code can be added to your site without obstacles, you can easily add PHP to make your site more dynamic when designing and maintaining your site.

Database connection

PHP can be compiled with functions connected to many databases. PHP and MySQL are now an excellent combination. You can also write your own peripheral functions to access the database indirectly. In this way, when you change the database you use, you can easily change the encoding to adapt to this change. PHPLIB is the most commonly used basic library, which can provide general transaction requirements.

expansibility

As mentioned earlier, PHP has entered a period of rapid development. It may be difficult for a non-programmer to extend the additional functions of PHP, but it is not difficult for a PHP programmer.

object-oriented programming

PHP provides classes and objects. Web-based programming needs object-oriented programming ability very much. PHP supports constructors, extracting classes, and so on.

Measurability

Traditionally, the interaction of web pages is realized through CGI. The scalability of CGI programs is not ideal because it opens an independent process for each running CGI program. The solution is to compile interpreters (such as mod_perl, JSP) of languages that are often used to write CGI programs. PHP can be installed like this, although few people want to install it in CGI like this. Embedded PHP is more extensible.

More function

In order to be more suitable for web programming, PHP developers have developed many popular basic libraries, which contain easier-to-use layers. 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 emails. It can even complete network-related functions. Most importantly, you can choose which functions you need for the version of PHP you installed. To quote Xterra from Nissan, PHP can do anything you want it to do, it can do anything!

Introduction to MySQL

MySQL is a semi-commercial database, which is deeply loved by people in the Linux community. MySQL can run on most Linux platforms (i386, Sparc, etc.) and a few non-Linux or even non-Unix platforms.

licence fee

The popularity of MySQL is largely due to its looseness, except for a slightly unusual license fee. The price of MySQL varies depending on the platform and installation method. Windows versions of MySQL (NT and 9X) are not free under any circumstances, while MySQL of any Unix variant (including Linux) is free if it is installed by the user himself or the system administrator instead of the third party, and the third party solution must pay the license fee.

price

Platform installation mode price

Windows NT, 9X, any $200.

Unix or Linux installation is free.

Unix or Linux third-party installation $200

A $200 application component is required.

You can get various support contracts, too many of which are not listed. Please consult MySQL website for the latest quotation.

3. Device

Most major software package formats (RPM, DBE, TGZ) can be obtained on MySQL site, while client libraries and language wrappers can be obtained in separate RPM formats. The installation of RPM format is not too troublesome and does not require initial configuration. An initial script will be generated in rc3.d (taking RedHat RPM as an example), so the MySQL daemon will be started when restarting in multi-user mode. Mysqld consumes very little memory (on Pentium 133 running RedHat 5. 1, each daemon uses 500K memory and another 4M shared memory), and it is only loaded on the processor when executing real queries, which means that MySQL can be easily used in small databases without having much impact on other system functions.

data type

It is a good thing that fields support a large number of data types. Common integers, floating-point numbers, strings and numbers are all expressed in various lengths, and support variable-length BLOB (binary large object) types. For integer fields, auto-increment options and date-time fields can also be well represented.

Unlike most other database systems, MySQL provides two relatively uncommon field types: ENUM and SET. ENUM is an enumeration type, which is very suitable for Pascal. It allows programmers to see field values such as' red',' green' and' blue', while MySQL only stores these values as one byte. SET is also borrowed from Pascal. It is also an enumeration type, but a field can store multiple values at a time. This ability to store multiple enumeration values may not impress you (it may threaten the definition of the third normal form), but the correct use of SET and CONTAINS keywords can save a lot of table connections and improve performance.

5.SQL compatibility

MySQL contains some changes different from the SQL standard, most of which are to make up for the shortage of SQL scripting language. However, some other extensions do set MySQL apart. For example, a LINK clause search automatically ignores case. MySQL also allows users to customize SQL functions. In other words, a programmer can write a function and integrate it into MySQL, and its performance is no different from any basic function such as SUM () or AVG (). This function must be compiled into a shared library file. So file), and then load it with the LOAD FUNCTION command.

There are also some commonly used SQL functions missing, and there is no sub-selection (query in query). The scenery is gone. Of course, most subqueries can be rewritten with a simple join clause, but sometimes it is easier to use two nested queries than one big join. Similarly, the view only hides the where clause for programmers, but this is another convenience that programmers expect.

Stored procedures and triggers

MySQL has no stored procedure language, which is the biggest limitation for programmers who are used to enterprise databases. Multi-statement SQL commands must be coordinated by client code. In this case, with the help of a fairly reliable query language and the ability to lock and unlock tables for clients, multi-statement operations are allowed.

7. Reference Integrity (RI)

One of the main defects of MySQL is the lack of standard RI mechanism. However, the founder of MySQL did not turn a deaf ear to the wishes of its users and provided some solutions. One of them is to support unique indexes. A large number of data types make up for the lack of rule restrictions (fixed range restrictions of fixed fields). Check constraints (restrictions on the value of one field relative to another in the same row), foreign keywords, and the "cascade deletion" function usually associated with RI are not simply provided. Interestingly, when these functions are not supported, the SQL analyzer tolerates the syntax of these statements. The purpose of this is to easily transplant the database to MySQL. This is a good attempt, and it really leaves a convenient door for supporting this function in the future; However, people who don't read the document carefully may mistakenly think that these functions actually exist.

7. Safety

From beginning to end, my biggest complaint about MySQL is its security system. Its only disadvantage is that it is complex rather than standard, and it will only change when calling mysqladmin to reread user permissions. The commonly used SQL GRANT/REVOKE statement was not supported until the latest version, but at least it is now supported. The author of MySQL has extensively recorded its specific security system, but it does need a learning process, and there may be no other way.

Apache+php+mysql is the best collocation, and it is also the best collocation with enterprise network.

If you study php, you can find many tutorials online. In fact, the best way to learn any program is to write, write and watch.

Of course, the best website is dreamweaver, which can write a lot of code and design!