PHP - Basics - Part 2 - Role of MySQL in PHP
Ekim 12, 2011 by PHP Tutorial
|
|
Article Information
This PHP Tutorial contains and tries to cover following subjects:
- Explanation the role of database MySQL in PHP
- Brief introduction to MySQL
Articles tries to provide answer to following questions and issues:
- What is MySQL
- Why to store data in database in PHP?
Articles pre-requisites following information:
- General knowledge of Scripting
- General knowledge of HTML
- General knowledge of CSS
- General knowledge of RDBMS and SQL
Introduction to MySQL in PHP
In this PHP Tutorial, we will cover What is role of database and MySQL in PHP
MySQL is a database system that is used with PHP projects. What is database? lets look at first. Database is a way of storing data with a system. Assume that we want to store our products and details in our PHP site. In old ways, plenty web site was storing data in files. Storing data in file used to cause problems. When products becomes more, file size gets bigger. When visitors check products in a site, it means one file is being accessed simultaneously. This could cause errors, if file is not locked correctly when multiple access happens to it. Also keeping data in a plain file without a real systematic organization or without relational entities makes file harder to modify.
SQL language which has a long past is a database language. We call it language because database systems and language itself causes confusion to new programmers. MySQL is a database system which uses SQL language. Similar to the Microsoft SQL Server. Microsoft SQL server is a database system, and uses SQL language. Oracle is also a database system using SQL.
This refers, if we know SQL language, using a database system of different systems are possible.
Database system stores data in Tables in a database file. Each Table contains columns. This helps asking database about a data - a cell easier. SQL language is similar to English language. For example we can ask a database bringing product names from product table like "select productNames from ProductTable".
In PHP side, mainly MySQL databases are used due to its being free.
We will cover MySQL in more details when working with PHP. For learning SQL, you can visit database section of CodeCandle, under SQL articles. It covers SQL language basics with examples.
Next part, we will look at Javascript and its role in PHP.
Data Layers
Area: | programming \ languages \ php \ \ \ |
Ref: | |
Loc: | articles |
Tags: | php |
|