Why can't I insert it?-php Tutorial

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.