Linux 版 (精华区)

发信人: netiscpu (网中鸟~~flying), 信区: Linux
标  题: [中英]PHP/MySQL教程(2-1)PHP/MySQL介绍
发信站: 紫 丁 香 (Thu Jan 13 03:45:51 2000) WWW-POST


[中英]PHP/MySQL教程(2-1)PHP/MySQL介绍
 
[原作者] Graeme Merrall
[出处] http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4
.html
[译者] netiscpu

PHP/MySQL Tutorial
by Graeme Merrall 

======================================================================

PHP和MySQL介绍

Introducing PHP and MySQL 
 
除非你已经在火星上生活了6至9个月,否则你没有理由不知道开放源码软件
(OSS,Open Source Software),开放源码运动已经得到极大的支持,以至于
大男孩子们都在谈论这项运动,而像Oracle,Informix和为数众多的其它公
司都在将它们的旗舰数据库产品投入到开放源码运动/Linux的怀抱中.

    Unless you've been living on Mars for the last six to eight 
    months, you've heard of open source software(OSS). This 
    movement has got so much momentum that even the big boys 
    are taking notice. Companies like Oracle, Informix, and a 
    host of others are releasing their flagship database products 
    for that poster child of the OSS movement, Linux. 

拥有一个庞大而复杂的关系数据库管理系统(RDBMS,relational database 
management system)着实是一件好事,但是前提条件是你知道如何应用它.
如果你想建立一个自己的基于数据库的网站(data-driven Web site),但是
你发现自己缺乏资源,或者对ASP服务器和价格高昂的数据库不感兴趣,你想
要一些免费的东西,而且能够运行在Unix平台.

    Having a massively complex RDBMS (relational database management 
    system) is all well and good if you know what to do with it. But 
    perhaps you are just getting into the world of databases. You've 
    read Jay's article and you want to put up your own data-driven 
    Web site. But you find you don't have the resources or desire for 
    an ASP server or some pricey database. You want something free, 
    and you want it to work with
    Unix. 

选择PHP/MySQL吧,两者的美妙组合是全世界最佳的基于数据库网站的解决方
案,这种说法不是空穴来风,一个非官方的站点Netcraft所做的调查显示,从
1998.3--1999.3,使用PHP的站点由7,500各站点激增至410,000,确实不赖.该
解决方案还获得Webcon98年度数据库奖,并且因此获得一个可爱的皇冠状的奖
励标志.

    Enter PHP and MySQL. These two make up what must be the best 
    combination for data-driven Web sites on the planet. You needn't 
    take my word for it. An unofficial Netcraft survey shows that 
    PHP usage has jumped from 7,500 hosts in June 1998 to 410,000 
    in March 1999. That's not bad. The combination was also awarded 
    Database of the Year at Webcon98, where it received a lovely tiara. 

MySQL是一个小巧,紧凑的数据库服务器,对于中小型应用来说是一个理想的选
择,另外,它还支持标准ANSI SQL,可以运行在大多数操作系统平台,当运行于
Unix平台时,还支持多线程,这大大提高了运行性能.对于非Unix平台来说,MySQL
可以作为Windows NT的一个服务或者Windows 95/98的一个普通进程来运行.

    MySQL is a small, compact database server ideal for small - and 
    not so small - applications. In addition to supporting standard 
    SQL (ANSI), it compiles on a number of platforms and has 
    multithreading abilities on Unix servers, which make for great 
    performance. For non-Unix people, MySQL can be run as a service 
    on Windows NT and as a normal process in Windows 95/98 machines. 

PHP是一种服务器嵌入语言,如果你见过ASP,就会对于HTML页面嵌入代码熟悉一
些.与ASP一样,PHP脚本(script)由Web服务器进行处理,处理之后,服务器返回
正常的纯HTML代码给浏览器,这种交互操作允许一些相当复杂的操作.

    PHP is a server-side scripting language. If you've seen ASP, 
    you'll be familiar with embedding code within an HTML page. 
    Like ASP, PHP script is processed by the Web server. After the 
    server plays with the PHP code,it returns plain old HTML back 
    to the browser. This kind of interaction allows for some pretty 
    complex operations. 

除了免费之外(MySQL有一些授权限制),PHP/MySQL解决方案还是跨平台的,这意
味着你可以在Windows平台上进行开发,而实际服务时,运行在Unix服务器上,并
且PHP还可以作为一个扩展的CGI进程,一个独立的脚本语言解释器或者一个内置
的Apache模块.

    In addition to being free (MySQL does have some licensing 
    restrictions though), the PHP-MySQL combination is also cross-
    platform, which means you can develop in Windows and serve on a 
    Unix platform. Also, PHP can be run as an external CGI process, 
    a stand-alone script interpreter, or an embedded Apache module. 

如果你感兴趣,PHP与无处不在的ODBC一样,还支持许多其它数据库产品,包括Oracle,
Informix,Sybase,Solid和PostgreSQL等等.

    If you're interested, PHP also supports a massive number of 
    databases, including Informix, Oracle, Sybase,Solid, and 
    PostgreSQL - as well as the ubiquitous ODBC. 

PHP还支持进行Internet开发所需要的许多特性,包括用户认证,XML,动态图像创
建,WDDX,内存共享和动态PDF文档创建.当然这些不是全部,PHP易于扩展,如果你
对编程有一定了解,你可以用它实现自己想要的解决方案.

    PHP supports a host of other features right at the technological 
    edge of Internet development. These include authentication, XML, 
    dynamic image creation, WDDX, shared memory support, and dynamic 
    PDF document creation to name but a few. If that's not enough, 
    PHP is easy to extend, so you can roll your own solution if you're 
    programming savvy. 

最后,由于这两个软件都是由众人协作完成的,所以,可以从文档和邮件列表(得到
丰富的支持,Bug已经发现很快就会被去除,大家会提出很多新特性要求,并且评估
是否必要,如果切实可行,就会在新的版本中很快实现.

    Finally, since both efforts are collaborative in nature, there's 
    always plenty of support from documentation and mailing lists. 
    Bugs are fixed rapidly, and requests for features are always heard, 
    evaluated, and if feasible, implemented. 

闲话少说,让我们开始进行教程吧.

    Enough talk! Let's go over what we're going to cover in this tutorial. 

第一课主要讲述如何在Unix和Windows系统中安装PHP/MySQL,如果你无需考虑这个问
题(也许你可以在你的ISP的服务器上进行开发工作,而这些机器可能已经安装了必要
的软件),可以直接跳到第一个脚本例子,开始你的梦幻旅行.

        Lesson 1 is going to cover the installation of these products on 
        both Unix and Windows systems.If you don't need to worry about 
        that (you're working on your ISP's machine, perhaps), jump right
        to the first example scripts, where the magic starts. 

在第二课中,我们将学习一些更复杂的脚本例子,包括循环,表单输入和发送数据到数
据库.

        In Lesson 2 we'll look at some more complex scripting goodies, 
        including looping, form input, and sending data from and to the 
        database. 

第三课里,我们会学到一些更深层次的技巧,以使你的PHP脚本更简洁高效.

        Lesson 3 will cover validation and techniques for making your PHP 
        scripts smart and clean. 

好了,这就是本教程将要讲述的所有内容.

    Let's roll. 

[未完待续]


--

                              Enjoy Linux!
                          -----It's FREE!-----

※ 修改:·netiscpu 於 Jan 13 03:45:51 修改本文·[FROM: ustsu54-nc2.ust] 
※ 来源:·紫 丁 香 bbs.hit.edu.cn·[FROM: ustsu54-nc2.ust] 
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.604毫秒