Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6914407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:20:37+00:00 2026-05-27T09:20:37+00:00

Table definition: CREATE TABLE IF NOT EXISTS `submenu_cat` ( `id` int(11) NOT NULL AUTO_INCREMENT,

  • 0

Table definition:

CREATE TABLE IF NOT EXISTS `submenu_cat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `menu_id` int(11) NOT NULL,
  `href` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `title` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `page_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `menu_id` (`menu_id`),
  KEY `page_id` (`page_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ;

Table data:

--
-- Άδειασμα δεδομένων του πίνακα `submenu_cat`
--

INSERT INTO `submenu_cat` (`id`, `menu_id`, `href`, `title`, `page_id`) VALUES
(1, 2, 'educational_events', 'Εκπαιδευτικές Εκδηλώσεις', 1),
(2, 2, 'announcements', 'Ανακοινώσεις', 1),
(3, 2, 'party', 'Party-Χοροί', 1),
(4, 2, 'various', 'Λοιπές δραστηριότητες', 1),
(5, 3, 'dap_hmmy', 'Προτάσεις ΔΑΠ-ΝΔΦΚ ΗΜΜΥ', 1),
(6, 3, 'dap_emp', 'Προτάσεις ΔΑΠ-ΝΔΦΚ ΕΜΠ', 1),
(7, 3, 'dap_aei', 'Προτάσεις ΔΑΠ-ΝΔΦΚ ΑΕΙ', 1);

Table constraints:

--
-- Περιορισμοί για πίνακα `submenu_cat`
--
ALTER TABLE `submenu_cat`
  ADD CONSTRAINT `submenu_cat_ibfk_1` 
    FOREIGN KEY (`menu_id`) 
      REFERENCES `menu_cat` (`id`) 
    ON UPDATE CASCADE,
  ADD CONSTRAINT `submenu_cat_ibfk_2` 
    FOREIGN KEY (`page_id`) 
      REFERENCES `pages` (`id`) 
    ON UPDATE CASCADE;

I wont to write in php something like that executes this

<ul id="m2">
   <li><a href="">Εκπαιδευτικές εκδηλώσεις</a></li>
   <li><a href="">Ανακοινώσεις</a></li>
   <li><a href="">Party-Χοροί</a></li>
   <li><a href="">Λοιπές δραστηριότητες</a></li>
</ul>
<ul id="m3">
   <li><a href="">Προτάσεις ΔΑΠ-ΝΔΦΚ ΗΜΜΥ</a></li>
   <li><a href="">Προτάσεις ΔΑΠ-ΝΔΦΚ ΕΜΠ</a></li>
   <li><a href="">Προτάσεις ΔΑΠ-ΝΔΦΚ ΑΕΙ</a></li>
</ul>

Can I do this with one query?

This will be done with one while loop? Or two?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:20:37+00:00Added an answer on May 27, 2026 at 9:20 am
    $result = mysql_query("SELECT menu_id,title FROM submenu_cat ORDER BY menu_id");
    
    $last = -1;
    while($result && $row = mysql_fetch_assoc($result)) {
       if ($last != $row['menu_id']) {
           if ($last != -1) {
               print "</ul>\n";
           }
           print "<ul id=\"m{$row['menu_id']}\">\n";
           $last = $row['menu_id'];
       } 
       print "  <li><a href=\"\">".htmlentities($row['title'])."</a></li>\n";
    }
    if ($last != -1) {
       print "</ul>\n";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following table definition: CREATE TABLE Customers( id INT NOT NULL PRIMARY KEY, name
Table definition: CREATE TABLE [dbo].[AllErrors]( [ID] [int] IDENTITY(1,1) NOT NULL, [DomainLogin] [nvarchar](50) NULL, [ExceptionDate]
In this MySQL table definition: CREATE TABLE groups ( ug_main_grp_id smallint NOT NULL default
Database is MySQL with MyISAM engine. Table definition: CREATE TABLE IF NOT EXISTS matches
I have the following table definition: CREATE TABLE X ( A SOMETYPE NOT NULL,
given this table definition create table herb.app (appId int identity primary key , application
I am trying the following SQL statement: create table sample ( id int not
I have the following table declared in MySQL: CREATE TABLE IF NOT EXISTS `ci_sessions`
For the table definition CREATE TABLE Accounts ( AccountID INT , Filler CHAR(1000) )
I have a date_dimension table definition: CREATE TABLE date_dimension ( id integer primary key,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.