Why cannot I insert it?
-- Table structure for table 'Category '-- create table if not exists 'Category' ('id' int (11) not null AUTO_INCREMENT, 'catpath' varchar (255) default null, 'name' varchar (255) default null, primary key ('id') ENGINE = MyISAM default charset = utf8 AUTO_INCREMENT = 11; -- Dumping data for table 'Category '-- insert into 'category' ('id', 'catpath', 'name') VALUES (1, '0 ', 'Website'), (2, '0-1', 'Linux OS '), (3, '0-1', 'Apache server'), (4, '0-1', 'MySQL database'), (5, '0-1', 'php scripting language '), (6, '0-1-2 ', 'Linux system example'), (7, '0-1-2 ', 'Linux network technology'), (8, '0-1-2 ', 'Linux security basics '), (9, '0-1-2-7 ', 'Linux LAMP'), (10, '0-1-3-10 ', 'Apache server ');
Insert into 'category '('id', (select concat (catpath,'-', id) as abspath from category order by abspath) as abspath, 'name ') VALUES (44, '0-1-2-11 ', 'site homepage ');
Why cannot I insert
Reply to discussion (solution)
Insert into 'category '('id', 'abspath', 'name') VALUES
(44, '0-1-2-11 ', 'site homepage ');
Fields in the category brackets. why are you writing SQL statements?
Insert into 'category '('id', 'abspath', 'name') VALUES
(44, '0-1-2-11 ', 'site homepage ');
Fields in the category brackets. why are you writing SQL statements?
Insert
Insert into 'category '('id', 'abspath', 'name') VALUES
(44, '0-1-2-11 ', 'site homepage ');
Fields in the category brackets. why are you writing SQL statements?
So how can I insert a feature that I want to implement?
Insert into 'category '('id', 'abspath', 'name') VALUES
(44, '0-1-2-11 ', 'site homepage ');
Fields in the category brackets. why are you writing SQL statements? I still use the original method.
Insert into 'category '('id', 'catpath', 'name') VALUES
(44, (select concat (catpath, '-', id) as abspath from category order by abspath) as abspath, 'Website ');
???
I don't know what to do. your category table does not have the abspath field.
Is this field catpath incorrect?