PHP is one of the “scripting languages” on the web. It is an interpreted language, interpreted by the official PHP compiler, developed specifically for web programming. Being quite similar to ASP in many ways, it’s possible that changing from ASP to PHP wouldn’t be that difficult for an experienced developer with experience in a C-type language.
PHP with Apache or another web server handles all aspects of a “standard” web service in development; It monitors requests, delivers them to the appropriate handlers, sends the requested headers, and finishes the job.
PHP in itself is a language capable of many simple things: date functions, file manipulation, mathematics, logic, all the elements of a traditional programming language (including some feature-packed mechanisms for topics like string manipulation and date manipulation) – but does not expand on the power that It is given by database-based web applications. Fortunately, there are standard libraries like MySQL, which allow you to easily integrate databases into your project.
A database is simply a collection of data. MySQL is a relational database server and query language. It allows users to easily create tables of information, which can be sorted by a number of columns, and capable of processing millions of rows of information. It is impressive when you look at its simplicity.
MySQL (pronounced My Sequel) is an implementation of popular SQL – “Structured Query Language” – don’t worry if you haven’t heard of SQL before – we’ll get there in a later lesson. Information can be stored in an SQL database, accessed in various ways, quickly processed, modified and stored.
But wait, why would we want to store our content in a database? Why not just store it in static files? This is an easy question. If you mean by flat files stored in plain text files and loaded into a PHP-based template system – the database is faster. If by static files you mean storing them in HTML files and linking them around, you may have already answered your question. HTML-only websites are messy, and often end up with hundreds of files, each with their own version of the template, among other things. A simple change to an HTML only site can take days to implement, as it may take minutes on a PHP-MySQL based site.
Furthermore, by integrating PHP + MySQL into your project, you can unlock a host of new uses. In the future, you can set up a web service for a software application to connect to your database server and get content, you can sell your content database, or you can manipulate the way content is stored further.
The advantages of a scripting language and database based website are numerous, and you should realize them more and more as you go deeper into web development.