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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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