1.1. PHP and MySQL's Place in Web DevelopmentPHP is a programming language designed to generate web pages interactively on the computer serving them, called a web server . Unlike HTML, where the web browser uses tags and markup to generate a page, PHP code runs between the requested page and the web server, adding to and changing the basic HTML output. For example, PHP code could be used to display a counter of visitors to a site. PHP, in less than 20 lines of code, can store the IP address from which a page request comes in a separate file, and then display the number of unique IP addresses that visited a particular site. The person requesting the web page doesn't know that PHP generated the page, because the counter text is part of the standard HTML markup language that the PHP code generated. PHP makes web development easy, because all the code you need is contained within the PHP framework. This means that there's no reason for you to reinvent the wheel each time you sit down to develop a PHP program; that would be something you'd have to do if you were using a compiled language like C. While PHP is great for developing web functionality, it is not a database. The database of choice for PHP developers is MySQL, which acts like a filing clerk for PHP-processed user information. MySQL automates the most common tasks related to storing and retrieving specific user information based on your supplied criteria.
MySQL is easily accessed from PHP, and they're commonly used together as they work well hand in hand. An added benefit is that PHP and MySQL run on various computer types and operating systems, including Mac OS X, Windows-based PCs, and Linux. 1.1.1. Advantages of Using PHP with MySQLThere are several factors that make using PHP and MySQL together a natural choice:
1.1.2. The Value of Open SourceAs we mentioned above, both PHP and MySQL are open source projects, so there's no need to worry about user licenses for every computer in your office or home. In open source projects and technologies, programmers have access to the source code; this enables individual or group analysis to identify potentially problematic code, test, debug, and offer changes as well as additions to that code. For example, Unixthe forerunner in the open source software communitywas freely shared with university software researchers. Linux, the free alternative to Unix, is a direct result of their efforts and the open source licensing paradigm. As Tim O'Reilly puts it, "Open source licensing began as an attempt to preserve a culture of sharing, and only later led to an expanded awareness of the value of that sharing." Today, open source programmers share their code changes on the Web via php.net, listservs, and web sites. If you're caught in a coding nightmare and can't wake up, the resources mentioned above can and will help you.
|