Tags
MySQL
Asked 3 years ago
2 Jul 2021
Views 377
Theo

Theo posted

Error in CREATE table statement in MySQL

Error in CREATE table statement in MySQL

SQL query:


CREATE TABLE `search` (
  `id` int() NOT NULL,
  `seachtext` text   NOT NULL,
   `view` int() NOT NULL
)


MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') NOT NULL,
`seachtext` text NOT NULL,
`view` int() NOT NULL
)' at line 2
Mitul Dabhi

Mitul Dabhi
answered Jul 24 '21 00:00

you did not pass int length,like int(11) or int(50)
correct query is

CREATE TABLE `search` (
  `id` int(11) NOT NULL,
  `seachtext` text   NOT NULL,
   `view` int(11) NOT NULL
)

Post Answer