Page 1 of 1

Creating HTML table problem

Posted: Mon Apr 11, 2005 1:56 pm
by OttoBufonto
Hi,
unfortunately another noob question (me thinks) but I simply can get my twisted mind around this.

I want to create a dynamic table with M rows and and N colums. Both are pulled from two sperate DB tables. One table (Table1) describes seasons and one (Table2) roles.
Building the table layout is not the problem.

I have a third table (Table3) that descibes individuals and the roles they had in differnt years.
like this
year 1_ID| person 1_ID| role 1_ID
year 1_ID| person 2_ID| role 5_ID
year 2_ID| person 4_ID| role 8_ID
etc.

I would like to add display logic, that adds the name of person 1 where his role and year matches the html table row/column intersect.

While building the table, for each cell I need to compare whether the row/comlumn value combination exist in the T3 array and if so pull the corresponding person name_ID /name.

Maybe I'm I'm thinking too complex, but I either end in indefinate loops or my differnt query result arrays don't get the matching result..

Cheers in advance for any pointers,
Otto

Posted: Mon Apr 11, 2005 2:40 pm
by John Cartwright
Post your code (with [syntax=php][/syntax] tags).