search
Homephp教程php手册thinkphp create new data table

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));

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.