PHP/MySQL Tutorial
Thông tin tài liệu:
Nội dung trích xuất từ tài liệu:
PHP/MySQL Tutorial PHP/MySQL Tutorial by Graeme Merrall Lesson 1:OverviewOpen source has brought a lot more than Linux to the computing world. It has also given us PHP andMySQL. According to Graeme, PHP and MySQL are the worlds best combination for creating data-drivensites. In the first installment of this three-lesson tutorial, our Kiwi guide covers everything you need toknow to begin developing database hubs. He gives instructions for installation on both Unix and Windows,and then goes on to show some simple scripts that will insert information into a database and display thatdata on a Web page.Lesson 2 covers more PHP/MySQL goodies than you could probably imagine. Graeme starts by showingwhile loops, then talks about the ever-useful if -else statement. But this information alone means little ifyou dont continue and see how PHP can be used with HTML forms. By the time youve polished off thislesson, youll be able to add, edit, and remove information from your database.In Lesson 3, Graeme shows some of the secrets that will turn your simple data-driven site into a usefulapplication. As he covers validation, hell show how to prevent users from leaving key form fields blank andhow to make sure numeric files dont contain letters. Hell also teach you how PHP handles includes andfunctions. Plus youll see how these two features, when deployed together, can make the coders life mucheasier. Graeme winds it all up with some tearful parting words and a bit of advice for the aspiringPHP/MySQL coder.Other PHP articles on Webmonkey:Site Navigation with PHPImage Creation with PHPThreaded Discussion with PHP/MySQL 1Introducing PHP and MySQLUnless youve been living on Mars for the last six to eight months, youve heard of open source software(OSS). This movement has got so much momentum that even the big boys are taking notice. Companieslike Oracle, Informix, and a host of others are releasing their flagship database products for that posterchild of the OSS movement, Linux.Having a massively complex RDBMS (relational database management system) is all well and good if youknow what to do with it. But perhaps you are just getting into the world of databases. Youve read Jaysarticle and you want to put up your own data-driven Web site. But you find you dont have the resourcesor desire for an ASP server or some pricey database. You want something free, and you want it to workwith Unix.Enter PHP and MySQL. These two make up what must be the best combination for data-driven Web siteson the planet. You neednt take my word for it. An unofficial Netcraft survey shows that PHP usage hasjumped from 7,500 hosts in June 1998 to 410,000 in March 1999. Thats not bad. The combination was alsoawarded Database of the Year at Webcon98, where it received a lovely tiara.MySQL is a small, compact database server ideal for small - and not so small - applications. In addition tosupporting standard SQL (ANSI), it compiles on a number of platforms and has multithreading abilities onUnix servers, which make for great performance. For non-Unix people, MySQL can be run as a service onWindows NT and as a normal process in Windows 95/98 machines.PHP is a server-side scripting language. If youve seen ASP, youll be familiar with embedding code within anHTML 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 complexoperations.In addition to being free (MySQL does have some licensing restrictions though), the PHP-MySQLcombination 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 Apachemodule.If youre interested, PHP also supports a massive number of databases, including Informix, Oracle, Sybase,Solid, and PostgreSQL - as well as the ubiquitous ODBC.PHP supports a host of other features right a the technological edge of Internet development. These tinclude authentication, XML, dynamic image creation, WDDX, shared memory support, and dynamic PDFdocument creation to name but a few. If thats not enough, PHP is easy to extend, so you can roll yourown solution if youre programming savvy.Finally, since both efforts are collaborative in nature, theres always plenty of support from documentationand mailing lists. Bugs are fixed rapidly, and requests for features are always heard, evaluated, and iffeasible, implemented.Enough talk! Lets go over what were going to cover in this tutorial.Lesson 1 is going to cover the installation of these products on both Unix and Windows systems. If youdont need to worry about that (youre working on your ISPs machine, perhaps), jump right to the firstexample scripts, where the magic starts.In Lesson 2 well look at some more complex scripting goodies, including looping, form input, and sendingdata from and to the database.Lesson 3 will cover validation and techniques for making your PHP scripts smart and clean.Lets roll.2Installing MySQLLets jump straight in, grab ourselves a copy of these great packages, and get hacking! This isnt simplestuff. There are lots of options available to you for obtaining, compiling, and installing the software. Letsdeal with MySQL first, as well need it before we get PHP going.MySQL central is http://www.mysql.com/. As befits a program of its stature, there are a zillion mirrorslocated all over the globe, so do the Internet a favor and pick the one closest to you.Youve ...
Tìm kiếm theo từ khóa liên quan:
ngôn ngữ PHP ngôn ngữ lập trình tài liệu lập trình phương pháp lập trình lý thuyết lập trình lập trình mạng máy tínhTài liệu cùng danh mục:
-
Tìm hiểu về lỗi tràn bộ đệm (Buffer Overflow)
5 trang 364 0 0 -
Giáo trình Cấu trúc dữ liệu và thuật toán trên C++
74 trang 344 0 0 -
Bài giảng Phân tích thiết kế phần mềm: Chương 7 - Trường ĐH Ngoại ngữ - Tin học TP.HCM
16 trang 335 0 0 -
180 trang 274 0 0
-
Giáo trình Lập trình hướng đối tượng: Phần 2
154 trang 253 0 0 -
173 trang 248 2 0
-
Bài giảng Phân tích thiết kế và giải thuật - Chương 2: Kỹ thuật thiết kế giải thuật
80 trang 244 0 0 -
Kiến thức phần cứng máy tính - Sửa chữa nâng cấp và cài đặt máy tính xách tay Tập 2
483 trang 243 3 0 -
Kỹ thuật lập trình trên Visual Basic 2005
148 trang 242 0 0 -
Bài giảng Phân tích thiết kế phần mềm: Chương 6 - Trường ĐH Ngoại ngữ - Tin học TP.HCM
12 trang 240 0 0
Tài liệu mới:
-
7 trang 0 0 0
-
Đánh giá kết quả điều trị đục thể thủy tinh nhân cứng bằng phẫu thuật phaco
5 trang 0 0 0 -
Nghiên cứu đặc điểm lâm sàng và kết quả điều trị glôcôm thứ phát do đục thể thủy tinh căng phồng
5 trang 0 0 0 -
8 trang 0 0 0
-
6 trang 0 0 0
-
Biện pháp tăng cường hoạt động vận động trước ảnh hưởng của lối sống hiện đại
4 trang 1 0 0 -
221 trang 0 0 0
-
6 trang 0 0 0
-
37 trang 1 0 0
-
Đề thi tuyển sinh vào lớp 10 môn Toán (Chuyên) năm 2024 có đáp án - Trường THCS Trường Yên, Hoa Lư
13 trang 1 0 0