Home > php教程 > php手册 > body text

thinkphp create new data table

WBOY
Release: 2016-09-29 09:18:54
Original
1704 people have browsed it

Because tp does not have a function to create a new table, I believe that many people use tp to create a new table in native form, but there will be a problem (error report) in native form. However, if an error is reported, the new table will be created successfully... There is a function to create a new table below. Everyone
$sql = << CREATE TABLE `system_novel_one` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` char(200) DEFAULT NULL COMMENT 'Chapter name',
`contents` text COMMENT 'Chapter text',
`next` int(11) DEFAULT NULL COMMENT 'Next chapter address',
`pid` int(11) DEFAULT NULL COMMENT 'Novel name',
`novel_url` char(50) DEFAULT NULL COMMENT 'Novel chapter address',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
sql;

dump(M()->execute($sql));

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template