Chapter 7: Structured Query Language


The purpose of this chapter is to explain the statements of the Structured Query Language (SQL), the programming language for database interactions.

Background

SQL is the standard way for programs to access databases. This includes creating tables, adding records, modifying or deleting records, and reading records. Although there are differences in the implementation of SQL by the different products, those differences are relatively minor. An example is that Access refers to character strings as TEXT, and MySQL uses the term CHAR.

The PHP and ASP/JavaScript scripts that you write will access the databases by constructing character strings that represent SQL statements. The code will make use of information entered into HTML forms to produce the strings. Each of the two systems, PHP and ASP, provides ways to establish connections to the database management systems (DBMS) software on the server for processing of the SQL statements. After the statements are processed and, in many situations, return information, the PHP and ASP/JavaScript scripts use the information to produce the customized HTML files for the browser on the client computer to display. You will find it useful to distinguish between three areas of computation:

  • HTML is interpreted by the browser on the client computer.

  • The PHP and the ASP/JavaScript are interpreted by the PHP and ASP interpreters, on the server. Actually, it is possible to separate the ASP case into two: what is pure JavaScript, and what are ASP object methods and properties.

  • The SQL statements are interpreted by the DBMS drivers, namely MS Access or MySQL. The DBMS is either on the server or a computer connected to the server.

Thus, your PHP and ASP scripts will contain parts that are to be interpreted right there, so to speak, by the PHP or ASP/JavaScript interpreter, or one of the other two places.

We cover the details of the connections to the database products and the intricacies of preparing the SQL statements in later chapters. This chapter will focus on what you can call “stand-alone” SQL statements—a worthy enough subject in its own right.




Creating Database Web Applications with PHP and ASP
Creating Database Web Applications with PHP and ASP (Charles River Media Internet & Web Design)
ISBN: 1584502649
EAN: 2147483647
Year: 2005
Pages: 125
Authors: Jeanine Meyer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net