Jump to content

[SOLVED] Multidimensional Arrays


adam291086

Recommended Posts

Ok i have solved my last problem of printing out the array for a specific day, problem is when i have two events on one day the latter of the two is only stored. Therefore i hopefully made a Multidimensional Array.

 

$arrDays = array();
$arrEvent = array();
while($row = mysql_fetch_array($result))
{
     $arrDays[] = $row['Day'] ;
     $Month = $row['Month'] ;
     $Year = $row['Year'] ;
     $arrEvent['day']= $row['Day'] ;
     $arrEvent['event']=$row['Event Details'];	
print_r($arrEvent);
}

 

When i print the array i get

 

Array ( [day] => 15 [event] => LA) Array ( [day] => 15 [event] => BLAH )

 

how do i say echo result if $adam = [day] 15?

Link to comment
https://forums.phpfreaks.com/topic/80606-solved-multidimensional-arrays/
Share on other sites

sorry, i have my calendar finally working and connecting to the database. When information from the database corresponds to a date on the calendar the day is highlight. If the user hoovers over the day a pop up screen appears with the event details.

 

This is the problem. When there are two events in the database only one piece of information is displayed on the popup. How do i solve this?

 

I thought i should use a Multidimensional Array.

 

$adam means nothing and i am trying to set some information to $adam. The information i want to set to adam is from my Multidimensional Array.

 

[day] 15 was taken from my quote, this quote is generated from print_r($arrEvent);.

 

I want to make $adam = to Array ( [day] => 15 [event] => BLAH )

 

Hope that helps.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.