PHP & MySQL
Posted by tutor | Posted in PHP Tutorial | Posted on 18-12-2009-05-2008
0
As you already know that PHP is a scripting language which is used to create dynamic contents on a website. The dynamic content may be some static information like a single image with effects or a single line as a banner. But there could be a serious need to store and retrieve some information at times. All of the content management systems, blogs or only a simple form processor use database.
The best and the most often used database with PHP is MySQL. MySQL is the most popular open-source database system. It is simple to use, and easy to interface with.
A database in general is a repository of information, where data is stored in a format which can easily operated upon.
The most common and widely used type of database is relation where the data is stored in tables. Tables are database objects which consists of columns and rows. A table contain similar kind of data associated to each other by some defined relation. Some tables may also be related to each other. Each table has a set of primary keys which are used to refer to the data uniquely. Primary key is a set of some information which is unique for each row.
Databases are useful when storing information categorically.
Database Tables
A database most often contains one or more tables. Each table is identified by a name. Each table contains records with data.
Below is an example of a table called “Country”:
| Country | Capital |
| India | Delhi |
| United States of America | Washington D.C. |
| Zimbabwe | Harare |
| Poland | Warsaw |
The table above contains four records, one for each country and two columns, Country and capital.
