Learn PHP and MySQL with Examples


Chapter 5 - PHP and MySQL


PHP stands for PHP: Hypertext Preprocessor. It is a server-side scripting language, which can be embedded in HTML or used as a standalone binary (although the former use is much more common). PHP is a powerful tool for making dynamic and interactive Web pages and is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. Below are some basic general facts about PHP: PHP is a server-side scripting language and its scripts are executed on the server. PHP is an open source software and is free to download and use. PHP files have extensions ".php", ".php3", or ".phtml". These files can hold text, HTML tags and scripts. PHP files are returned to the browser as plain HTML. PHP supports many databases (MySQL, Oracle, PostgreSQL, Sybase, Informix, Solid, Generic ODBC, etc.) PHP is easy to learn, compared to the other ways to achieve similar functionality. Unlike Java Server Pages or C-based CGI, PHP doesn’t require you to gain a deep understanding of a major programming language before you can make a trivial database or remote-server call. Unlike Perl, which has been called a “write-only language,” PHP has a syntax that is quite easy to parse and humanfriendly. And unlike ASP.NET, PHP is stable and ready to solve your problems today.


MySQL (pronounced My Ess Q El) is an open source, SQL Relational Database Management System (RDBMS) that is free for many uses. It is used to store data. Data in MySQL is stored in objects called tables. For example, a database of a company can have the following tables:
- Customers
- Vendors
- Products
- Orders
- Contact