Styles2304 Posted August 25, 2007 Share Posted August 25, 2007 Ok, if anyone read my previous post they'll know a little bit about what I'm talking about. I got the calendar to do everything I need it to except for one thing. The date field in mysql requires the date be 2007-08-07. For some reason, the code has no problem recognizing 08 as 8 but it doesn't recognize 07 as 7. The calendar itself spits out 7 as opposed to 07 so when I compare the two, it doesn't recognize it as part of the array. Does anyone know how to remedy this? Here is the code that actually does the checking: if ($EventDate[$i]) { echo "<td width='24' height='16' class='event'><a href='showevent.php?day=$i' class='calendar'>$i</a></td>"; So like I said it's checking to see if, in this particular case, $EventDate[7] exists but actually . . . it's $EventDate[07] . . . does that make sense? I would think the easiest way would be to convert 07 to 7 someway . . . but I don't know how. Link to comment https://forums.phpfreaks.com/topic/66661-solved-new-problem-with-event-calendar-but-so-very-close/ Share on other sites More sharing options...
AndyB Posted August 25, 2007 Share Posted August 25, 2007 07 is a string. You need to convert it to a number, intval() will do that. Link to comment https://forums.phpfreaks.com/topic/66661-solved-new-problem-with-event-calendar-but-so-very-close/#findComment-333994 Share on other sites More sharing options...
Styles2304 Posted August 25, 2007 Author Share Posted August 25, 2007 Thank you . . . it is complete! lol. Seriously, thanks. Link to comment https://forums.phpfreaks.com/topic/66661-solved-new-problem-with-event-calendar-but-so-very-close/#findComment-333998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.