Creating Database-Driven Web Pages Using PHP and SQL Server on Linux

The technology for creating web pages based on database table information has been mature for many years. Many web sites are backed by databases, which allows the website to change based on changes to the database; this is especially true of news sites and e-commerce sites. Many sites also allow the user to choose what to see through search boxes or other user-input mechanisms, which make it easier to find what you are interested in by searching for keywords. Others allow you to change database tables by registering a login name or purchasing a product.

In the following tutorials, you will learn how to add the ability to access a SQL Server database from Linux, how to export Access tables to SQL Server, and how to dynamically change your web pages using an underlying database.

There is also a condensed presentation on most of the same topics as above, and a more recent presentation that provides more background knowledge.

Background

One Institute class wanted to use an Access database on the web. Microsoft provides some easy mechanisms to allow this, but one is restricted to using their IIS web server and SQL Server database server. If the company the students would be working for didn't use IIS and SQL Server, the students' skills would be difficult to transfer to that other system.

In this tutorial, we use SQL Server as the industrial-strength database server because it is easiest means to export Access tables to SQL Server tables. We wanted that process to be as painless as possible because the emphasis was on developing the web pages and logic to access the database, not on the problems of migrating a database from one server to another. Otherwise, we might have utilized a free, industrial-strength database server such as MySQL or Firebird.

A Linux-based Apache web server was available and familiar to the class. However, it was maintained by UW Seattle, and it could not be modified to support accessing SQL Server databases. A local Linux system, cssgate, could be.

PHP was chosen as the server-side scripting language. PHP was designed to assist users in building dynamic web pages, and supports a wide variety of database access technologies, including one that can utilize Open Database Connectivity (or ODBC) functionality. PHP can also run under a Windows IIS web server, or a Windows-based Apache web server.