Jump to content

LBernoulli

New Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by LBernoulli

  1. Hi everybody, and thank you in advance. I'm new to this forum and to PHP/MySql.
     
    I've a table:

    CREATE TABLE IF NOT EXISTS `Test` ( 
    `ID` INT NOT NULL AUTO_INCREMENT , 
    `Parent` VARCHAR(45) NOT NULL , 
    `Child` VARCHAR(45) NOT NULL , 
    PRIMARY KEY (`ID`) ) 
    ENGINE = InnoDB; 
    
    
    INSERT INTO `Test` (`ID`,`Parent`,`Child`) VALUES ('1', 'X', 'a'); 
    INSERT INTO `Test` (`ID`,`Parent`,`Child`) VALUES ('2', 'X', 'b'); 
    INSERT INTO `Test` (`ID`,`Parent`,`Child`) VALUES ('3', 'X', 'c'); 
    INSERT INTO `Test` (`ID`,`Parent`,`Child`) VALUES ('4', 'Y', 'a'); 
    INSERT INTO `Test` (`ID`,`Parent`,`Child`) VALUES ('5', 'Y', 'b'); 
    INSERT INTO `Test` (`ID`,`Parent`,`Child`) VALUES ('6', 'Z', 'a'); 
    INSERT INTO `Test` (`ID`,`Parent`,`Child`) VALUES ('7', 'W', 'a'); 
    INSERT INTO `Test` (`ID`,`Parent`,`Child`) VALUES ('8', 'W', 'b'); 
    INSERT INTO `Test` (`ID`,`Parent`,`Child`) VALUES ('9', 'W', 'c'); 
    

    The idea is to print, using PHP (in a HTML page), this (for every parent every child into the table):

    X

    a

    b

    c

     

    Y

    a

    b

     

    Z

    a

     

    W

    a

    b

    c

     

    Do you have an idea/suggestion to make that?

    Thanks

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.