Jump to content

Table syntax error


jer37

Recommended Posts

I am using xammp for my local server. Also using Mysql version 5.1.

I am trying to create the following table:

----------------------------------------------

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

 

--

-- Table structure for table `printer_category`

--

 

CREATE TABLE IF NOT EXISTS `printer_category` (

  `printer_category_id` int(11) NOT NULL auto_increment,

  `parent_id` int(11) NOT NULL,

  `category_name` varchar(255) NOT NULL,

  `lablename` varchar(255) NOT NULL,

  `productids` text NOT NULL,

  `status` enum('Y','N') NOT NULL default 'Y',

  PRIMARY KEY  (`printer_category_id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3018 ;

 

--

-- Dumping data for table `printer_category`

--

 

INSERT INTO `printer_category` (`printer_category_id`, `parent_id`, `category_name`, `lablename`, `productids`, `status`) VALUES

(1, 0, 'Filter', 'Filter', '', 'Y'),

------------------------------------------------------------

It looks like a version problem but being a Mysql amateur I cannot find the syntax problem. The error message I get is:

-------------------------------------------------------------

Error

 

SQL query:

 

--

-- Dumping data for table `printer_category`

--

INSERT INTO `printer_category` ( `printer_category_id` , `parent_id` , `category_name` , `lablename` , `productids` , `status` )

VALUES ( 1, 0, 'Filter', 'Filter', '', 'Y' ) ,

 

MySQL said: Documentation

#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 '' at line 6

------------------------

Where is the error or what is the correct syntax.?

 

jer37

 

PS. Just joined the forum, glad to be here

Link to comment
https://forums.phpfreaks.com/topic/214550-table-syntax-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.