Creating Databases  «Prev 

Integrating a database with a Website

How Web Database Architectures Work

Web database architectures work using the following steps:
  1. A user's web browser issues an HTTP request for a particular web page. Data is submitted using an HTML form. The search results page is called results.php.
  2. The web server receives the request for results.php, retrieves the file, and passes it to the PHP engine for processing.
  3. The PHP engine begins parsing the script. Inside the script is a command to connect to the database and execute a query (perform the search for books). PHP opens a connection to the MySQL server and sends on the appropriate query.
  4. The MySQL server receives the database query, processes it, and sends the results (a list of books) back to the PHP engine.
  5. The PHP engine finishes running the script.This usually involves formatting the query results nicely in HTML. It then returns the resulting HTML to the web server.
  6. The web server passes the HTML back to the browser, where the user can see the list of books she requested.

SQL and Relational Theory

Communication Process

The client sends a request to the Web Server

The web server sends this request to the database server

The database server queries the database and gets the information

The database server returns this information to the web server

The web server sends information to the client