Giter Site home page Giter Site logo

basemax / megamenuc Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 36 KB

MegaMenuC is a simple menu system for C that allows you to recursively get menu items and its submenus.

License: GNU General Public License v3.0

C 100.00%
c mega-menu megamenu mysql recursive recursive-algorithm recursive-functions sql

megamenuc's Introduction

Mega Menu C

MegaMenuC is a simple menu system for C that allows you to recursively get menu items and its submenus.

Using

$ gcc menu.c -o menu -I/usr/include/mysql -lmysqlclient
$ ./menu

Tree

- Personal cabinet
- News
     - Sub Test 1
          - Sub Test 2
- Sitemap
     - Sub Test 1
          - Sub Test 2
- Information
     - Sub Test 1
          - Sub Test 2
- Contacts
- System
     - Official site
     - Supporting forum

Test Table Data

Menu:

ID Menu ID Parent ID
1 1 NULL
2 2 NULL
3 3 NULL
4 4 NULL
5 5 NULL
6 6 NULL
7 7 6
8 8 6
9 9 2
10 9 3
11 9 4
12 10 9

Menu Item:

ID Name
1 Personal cabinet
2 News
3 Sitemap
4 Information
5 Contacts
6 System
7 Official site
8 Supporting forum
9 Sub Test 1
10, Sub Test 2

Database Structure

CREATE TABLE `menu` (
  `id` int(20) NOT NULL,
  `menu_id` int(20) NOT NULL,
  `parent_id` int(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `menu_item` (
  `id` int(20) NOT NULL,
  `name` varchar(54) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

© Copyright 2022, Max Base

megamenuc's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.