Sunday, November 21, 2010

HTML, PHP and MySQL overview

PHP is a server-side scripting language. It is often used together with HTML to "pass" information to the server. MySQL is a Relational Database Management System (RDMS). In simpler terms, it is a database management system which is used to store data into tables. These tables are linked together by relationships (Hence it is called a Relational Database). 


Here is a basic application for a HTML form. The form data is saved into the database. Below shows the sequential flow for a simple data insert into the database.


As seen in the flowchart above, 
  1. After the user keys in the data on the HTML form, it will be sent to PHP. 
  2. PHP gathers the data and connects to MySQL (How it connects, we will discuss in further blog entries). 
  3. After the connection is done, PHP sends the data to MySQL. MySQL receives the data and stores it.

Another application is when a user wants to search for things inside a database. For example, you might want to search for the availability of a book in the library. Below shows how a user starts the search and how the results are displayed to the user.




  1. The User enters a search request in HTML. 
  2. PHP gathers data from HTML, connects and send the query to MySQL. Query is like a search request. For example, the results that you are interested to find, are books which are published in the year 2010 only. With so many books in the library's database, PHP must provide a query to MySQL so that it can return the correct information.
  3. Once MySQL receives the query from PHP, it will perform the search in its database. 
  4. After the search, it will return the results to PHP. 
  5. PHP will retrieve the results from MySQL and send it back to HTML. 
  6. HTML will now display the results for the user to see.


Hope you all enjoy my HTML, PHP and MySQL overview! Do subscribe to my blogspot! Do share with me if I make any mistakes. If you have any topics to discuss, do let me know so that I can post it up! =) 

No comments:

Post a Comment