'phpmyadmin I am trying to create a "category" table on my localhost server using PhpMyAdmin

Query that I have used is:


DROP TABLE IF EXISTS `category`;
CREATE TABLE IF NOT EXISTS `category` (
  `category_id` int(11) NOT NULL AUTO_INCREMENT,
  `category_name` varchar(50) NOT NULL,
  `category_status` enum('0','1') NOT NULL,
  PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `category`
--

INSERT INTO `category` (`category_id`, `category_name`, `category_status`) VALUES
(1, 'Flu & Cold', '1'),
(2, 'Vitamins & Supplements', '1'),
(3, 'Chickenpox', '0');

This query executes successfully initially but when I tend to browse the table, this error shows up

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE TABLE IF NOT EXISTS category ( category_id int(11) NOT NULL AUT...' at line 2 enter image description here I am using xampp 8.1.4-1.

But I can view the structure of the table enter image description here



Solution 1:[1]

SELECT * FROM category

shows all the rows of the category table. I figured this is not an error.[Even though I cannot access the category table inside the PHPMYADMIN. ]

Thanks. Any suggestions are welcomed.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bikash Pandey