1 Reply Latest reply on Sep 5, 2008 9:02 AM by (shane_mosier)

    Multidimensional arrays

      Im hoping someone could help me with this.

      I have a database table called reports which contains the fields engine keyword and position which contains data as below:

      Engine keyword Position
      Google holiday 1
      Altavista holiday 3
      Yahoo holiday 11
      Google holiday offers 3
      Altavista holiday offers 31
      Yahoo holiday offers 13

      What i want to do is display the information in a html table like:

      Keyword Google Altavista Yahoo
      holiday 1 3 11
      holiday offers 3 31 13

      the list of different engines could grow so the outputted table would need to grow horizontally.

      Help appreciated
        • 1. Re: Multidimensional arrays
          Level 1
          poorleno,

          How comfortable are you with hand coding php? This would take a bit of hand coding to get working.

          You would probably have to do a couple of Recordsets. One Recordset would grab all the Engine names for the first table row. Loop thru this Recordset to get all the Engine names and then display them as the first row of your table.

          Another Recordset would grab all the data, grouped and sorted so that you loop thru it row-by-row it displays correctly. Then loop thru this to write all the subsequent table rows.

          You will need to be comfortable hand coding php and writing custom MySQL queries.

          Hope this helps,

          Shane