Приглашаем посетить
Дельвиг (delvig.lit-info.ru)

Chapter 18. Application of SQL and PHP to databases

Table of Contents

Previous Next

Chapter 18. Application of SQL and PHP to databases

By finishing Chapter 17, you should now have some experience of database programming on the Web and some general database pages ready for action. In fact, all the programs introduced in the previous chapter are SQL test programs. They are handy and practical because they allow you or users to send SQL statements to databases performing all kinds of database-related actions. In order to use these programs effectively, you may need to have a basic knowledge SQL and its statements, but a solid understanding of SQL is far more important than that. From a practical point of view, knowledge of SQL is considered as the single important key for designing successful database applications on the Web. For example, as a Web programmer for an online banking corporation, say, you cannot expect your front end users to understand SQL; all SQL actions should be transparent to users.

The first part of this chapter is dedicated to a background study of SQL. Some frequently used SQL statements and aggregate functions are introduced. You can use any database programs developed in the previous chapter to run and test the SQL performance. By default, we assume the MySQL database is installed. SQL is a database-independent language and therefore can be applied to any SQL-based database application. Once you have aquired some knowledge of SQL, the second half of the chapter concentrates on how to use it to design some database applications for front end users. For this part, PHP is used as the action scripting language. PHP was designed with databases in mind and the built-in support for MySQL and ODBC makes it an ideal choice for database applications. When working with databases, PHP is a very effective tool. First, let's consider some SQL statements to create databases and tables.

    Table of Contents

    Previous Next