Web Database Programming Using PHP
In the previous chapter, we gave an overview of data-base programming techniques using traditional programming languages, and we used the Java and C programming languages in our examples. We now turn our attention to how databases are accessed from scripting languages. Many electronic commerce (e-commerce) and other Internet applications that provide Web interfaces to access information stored in one or more data-bases use scripting languages. These languages are often used to generate HTML documents, which are then displayed by the Web browser for interaction with the user.
In Chapter 12, we gave an overview of the XML language for data representation and exchange on the Web, and discussed some of the ways in which it can be used. We introduced HTML and discussed how it differs from XML. Basic HTML is useful for generatingstatic Web pages with fixed text and other objects, but most e-commerce applications require Web pages that provide interactive features with the user. For example, consider the case of an airline customer who wants to check the arrival time and gate information of a particular flight. The user may enter information such as a date and flight number in certain form fields of the Web page. The Web program must first submit a query to the airline database to retrieve this information, and then display it. Such Web pages, where part of the information is extracted from databases or other data sources, are called dynamic Web pages. The data extracted and displayed each time will be for different flights and dates.
This chapter is organized as follows. Section 14.1 gives a simple example to illustrate how PHP can be used. Section 14.2 gives a general overview of the PHP language, and how it is used to program some basic functions for interactive Web pages. Section 14.3 focuses on using PHP to interact with SQL databases through a library of functions known as PEAR DB. Finally, Section 14.4 contains a chapter summary.
Copyright © 2018-2020 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.