PHP Help please.

Discussion in 'PHP' started by Marshton, May 13, 2010.

  1. #1
    First off:

    My database has 625 records and is set out like:

    Column Name: World | Quadrant | SHC1 | SHC2

    Records:
    1 | 1 | 1 | 1
    1 | 1 | 1 | 2
    1 | 1 | 1 | 3
    until...
    1 | 1 | 1 | 25
    1 | 1 | 2 | 1
    1 | 1 | 2 | 2
    1 | 1 | 2 | 3
    until...
    1 | 1 | 25 | 25

    SHC1 is the '15' in the coordinates '15:10'
    SHC2 is the '10' in the coordinates '15:10'

    I want to Put all the data from that mysql table into a (HTML) table similar to the one that I attached in Excel Format. (This would be done by PHP)

    If you can help, and if this made sense it'd be much appreciated.

    I know this is confusing, but if you can help it'd really be awesome :)
     

    Attached Files:

    Marshton, May 13, 2010 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,901
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    Looks like homework to me :)

    Just loop through the result set and save certain values to $oldSHC1 (for instance) and when $oldSHC1 <> $row['SHC1'] echo out the code to end the table row and start a new one.
     
    sarahk, May 13, 2010 IP
  3. Marshton

    Marshton Peon

    Messages:
    109
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Trust me; it's not!

    ICT homework is a lot easier :)

    I'll try that out, thanks.
     
    Marshton, May 13, 2010 IP