01-06-2012, 03:34 PM
PHP AND MYSQL BY EXAMPLE
PHP AND MYSQL BY EXAMPLE.pdf (Size: 9.21 MB / Downloads: 307)
Introduction
The original Web was funded by the government, limited to research and education. The Web sites were made up of a
collection of documents written in the HTML language. The pages were text based, simple, and static. Every time the
user reloaded a page in his or her browser, it looked exactly the same. It consisted of HTML text, images, and links. It
was not the complex commercial Web we know today where you can do anything from online shopping, to trading
stocks, booking vacations, or finding a mate. Static Web pages were useful for sending and retrieving reports, pictures,
and articles, but they couldn’t manage data that changed, remember users’ names and preferences, instantly create
customized output from a database, or embed streaming video into a page on the fly. As the Web grew and became a
virtual shopping mall, competitors needed Web sites that would lure in potential buyers and traders with an interactive
and exciting experience, quick response time, and on-the-fly feedback. They needed dynamic Web sites.
About PHP
So what is PHP? PHP is a simple, fast, portable scripting language well suited for development of database-enabled
Web sites. It was developed in 1995 and is currently powering tens of millions of Web sites worldwide. The
predecessor to PHP was PHP/FI, Personal Home page/Forms Interpreter, developed by Rasmus Lerdorf in 1995 to help
him track the number of visitors accessing his online résumé. It was basically a set of Perl/CGI scripts later rewritten by
Lerdorf in the C language and open-sourced; that is, made freely available. PHP was very Perl-like in sytnax, but
whereas Perl is an all-purpose, jack-of-all-trades scripting language, PHP was designed specifically to master the Web.
PHP instructions can be embedded with HTML right in the Web page so that whenever the page is loaded, PHP can
execute its code. PHP made processing forms easier by providing automatic interpretation of form variables. It allowed
for interaction with databases. It enabled users to create simple dynamic Web sites. The toolset Rasmus Lerdorf
developed was so popular that in 1997, PHP/FI 2.0 was released. Due to the popularity of this new release, Lerdorf was
soon joined by a core group of developers, who continued to provide improvements and enhancements to the new
language. By this time, there where thousands of users and approximately 50,000 Web sites running PHP/FI pages.
Zeev Suraski and Andi Gutmans, two students attending Technion-Israel Institute of Technology, needed a language for
their university e-commerce project. They chose PHP/FI for their project. Dissatisfied with its limitations and bugs,
they put their project aside, and rewrote PHP almost from scratch. PHP 3.0 was a significant departure from the
previous code base. The new language supported add-on modules and had a much more consistent syntax. At this time,
the meaning of the acronym changed as well. PHP now stands for PHP: Hypertext Preprocessor. PHP 3.0 was released
in 1998 and is the closest version to PHP today.
About MySQL
Today many organizations face the double threat of increasing volumes of data and transactions coinciding with a need
to reduce spending. Many such organizations are migrating to open source database management systems to keep costs
down and minimize change to their existing systems. The world’s most popular of these open source database systems
(it’s free to download, use, and modify) is MySQL. It is distributed and supported by MySQL AB, a Swedish.