adam291086 Posted December 7, 2007 Share Posted December 7, 2007 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? Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted December 7, 2007 Share Posted December 7, 2007 I'd love to help... I just don't understand the way you ask questions.... ?? I don't grasp at all what $adam is, or what [day] 15 is... PhREEEk Quote Link to comment Share on other sites More sharing options...
adam291086 Posted December 7, 2007 Author Share Posted December 7, 2007 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. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted December 7, 2007 Share Posted December 7, 2007 Well, might be too obvious, but... Just do a foreach over the corresponding day... <?php foreach ( $arrEvent[15] as $val ) { echo $val // data goes to the popup } PhREEEk Quote Link to comment Share on other sites More sharing options...
adam291086 Posted December 7, 2007 Author Share Posted December 7, 2007 The problem with that is we are hard coding with 15. I need it to say that with every record from the database without me manually doing it. Quote Link to comment Share on other sites More sharing options...
adam291086 Posted December 7, 2007 Author Share Posted December 7, 2007 anyone? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 7, 2007 Share Posted December 7, 2007 Replace [15] with your daynum variable. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.