· 8 years ago · Aug 19, 2018, 09:36 PM
1$sql = "CREATE TABLE IF NOT EXISTS `portal` (
2 Â `id` int(255) NOT NULL AUTO_INCREMENT,
3 Â `message_sid` varchar(255) NOT NULL,
4 Â `name` varchar(255) NOT NULL,
5 Â `number` varchar(255) NOT NULL,
6 Â `message` text NOT NULL,
7 Â `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
8 Â `status` varchar(50) NOT NULL,
9 Â PRIMARY KEY (`id`)
10) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1";
11 if (mysqli_query($conn, $sql)) {
12 echo "Table portal created successfully";
13 } else {
14 echo "Error creating table: " . mysqli_error($conn);
15 }
16
17You have an error in your SQL syntax;
18check the manual that corresponds to your MariaDB server version for the
19right syntax to use near '`id` int(255) NOT NULL AUTO_INCREMENT,
20`message_sid` varchar(255) NOT NULL' at line 2