Php+mysql implementation of the two-level linkage menu effect of detailed _php skills

Source: Internet
Author: User

This article describes the two-level linkage menu effect implemented by Php+mysql. Share to everyone for your reference, specific as follows:

<!--Php+mysql Two-level linkage-->  

SQL statement:

Structure of the----table ' colleges '--CREATE table IF not EXISTS ' colleges ' (' college_id ' int (8) not NULL auto_increment COMMENT ' College The number automatically increases ', ' name ' varchar () not NULL COMMENT ' College name ', PRIMARY key (' college_id '), UNIQUE key ' name ' (' name ') engine=in
Nodb DEFAULT charset=gb2312 auto_increment=7; ----Export the data in the table ' colleges '--INSERT into ' colleges ' (' college_id ', ' name ') VALUES (4, ' Chemistry and Chemical College '), (1, ' College of Computer and Information Science '), (6, ' Beauty
College of Surgery '), (2, ' Faculty of Arts '), (5, ' Conservatory of Music '), (3, ' School of Political and Public administration '); ----table's structure ' majors '--CREATE table IF not EXISTS ' majors ' (' major_id ' int (8) Not NULL auto_increment ' professional number, automatically increased ' , ' name ' varchar NOT NULL COMMENT ' professional name ', ' college_id ' int (8) Default NULL COMMENT ' Institute ', ' counsellor_id ' int (d) Efault NULL COMMENT ' counselor ', PRIMARY key (' major_id '), UNIQUE key ' college_id ' (' college_id ', ' counsellor_id ') Engine=inn
ODB DEFAULT charset=gb2312 auto_increment=8; ----Export the data in the table ' majors '--INSERT into ' majors ' (' major_id ', ' name ', ' college_id ', ' counsellor_id ') VALUES (1, ' e-commerce ', 1, 1
),(2, ' musical Solfeggio ', 5, 1), (3, ' classical literature ', 2, 1), (4, ' Computer Science ', 1, NULL), (5, ' Automation ', 1, NULL), (6, ' modern literature ', 2, NULL), (7, ' News Writing ', 2, NUL

 L);

More about PHP Interested readers can view the site topics: "PHP based on PDO Operation Database Skills Summary", "PHP+MONGODB Database Operation Skills Encyclopedia", "PHP object-oriented Programming Program Introduction", "PHP string (String) Usage Summary", " Introduction to PHP+MYSQL Database operations and a summary of PHP common database operations Tips

I hope this article will help you with the PHP program design.

Related Article

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.