Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4257 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a table with fields State, StateDataThisYear, and StateDataNextYear.  I want to end up with two html tables (one for this year and one for next) with the StateData in the table. The StateData is either the state name and a link to an anchor further down the page, or just the state name.  This table will be used as a Table of Contents for other data on the page.  The objective is to allow the page user to quickly see if there are events in a state and navigate to details if there are.

 

I think I want the data in a php array formatted like this:

 

Array
(
   [<<State>>] => Array
      (
         [0] => <<StateDataThisYear>>
         [1] => <<StateDataNextYear>>
      )
...
)

and then use a loop to put the StateData in its respective table.

 

I haven't been able to get the syntax right in the foreach loop of extracted records to obtain this array. Can someone help me with the php syntax, or suggest a better way?

Posted

How does the array naturally return?

 

I'd probably just use two loops on the result set to build the two tables...

Posted

Thanks, Tim.  That's what I ended up doing. I finally realized that I didn't need to use the combined data anywhere else, so the fancy-schmancy multidimensional array wasn't necessary.

This topic is 4257 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.