Home >Database >Mysql Tutorial >What are the options for datatables in PHP? What is a storage engine?
We have learned so much about PHP, but I wonder what your options are for data tables in PHP? What is a storage engine? Have you fully mastered it? If not, then follow this article to continue learning
Table option list
The table option is when creating a table , the overall settings for the table mainly include the following: charset = the character encoding to be used.
engine = the storage engine to be used (also called table type),
auto_increment =Set the initial value of the auto-increment field of the current table, the default is 1comment='Some description text of the table'
Explanation;
1, set The character encoding is to be different from the database settings. If they are the same, there is no need to set them. Because it will automatically use database-level settings;
2, engine (storage engine) is a noun at the code level: InnoDB, MyIsam, BDB, archive, Memory.
What is a storage engine?
The storage engine is the "mechanism" that stores data on the hard disk. In fact, there are only a few mechanisms (as mentioned in the names above) and different storage engines. In fact, the storage mechanism is mainly designed from two major levels.
1, as fast as possible
2, as many functions as possible;
Choosing different storage engines is the "trade-off" of the above performance and functions.
Example demonstration:
#演示表选项语法: create table tab_xuanxiang( id int auto_increment primary key,name varchar(10), age tinyint charset = gbk,/*产当前效据库的字符编码是utF8*/engine = MyIsam, auto_increment = 100o,comment ="说明文字..."; insert into tab_xuanxiang (id,name,age)values(null,'张三',11)
Related learning recommendations: mysql tutorial (video)
The above is the detailed content of What are the options for datatables in PHP? What is a storage engine?. For more information, please follow other related articles on the PHP Chinese website!