2010年9月16日星期四

A Summary of MySQL

MySQL is a kind of database, which can store and manage many types of data like text, float, varchar, date, etc. It always companies with PHP to help the dynamic web site stores and retrieves the data entered or requested by users.

SQL systems consist of a set of databases. Each database consists of one or more tables, which are where data is stored. Tables have a format consisting of rows and columns. Each column has a name and datatype.
In MySQL, some of the common datatypes include varchar, int and float. Data is retrieved from SQL tables using the SELECT statement. Also, SQL has many other statements like INSERT, DELETE, etc to manage the tables and data within tables. However, different database users are granted different levels of authorities. For example, the highest level user, the database administrator, he or she can delete the whole database or do anything they need to the database. But, a lowest level of database user only has the right to read the data or accesses some parts of data instead of the whole database. So, MySQL has a very sophisticated structure of managing data in order to ensure the security of data.

Within PHP codes, we always use the statements like mysql_connect, mysql_select_db, mysql_query to connect a database server, choose one target database and select data from the tables. Donot forget a very vital statement: mysql_close as soon as finished retrieving data from database.

没有评论:

发表评论