And now I can't even begin to figure out what's wrong... Any help at all would be greatly appreciated. I'm fairly new at PHP coding, so it's probably something extremely simple that I'm missing.... Here's the code:
//Set the date default....
$dateArray = getdate();
$mo2Use = $dateArray['mon'];
//Initialize calendar information....
$month = array(1=>"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
$startDays = array(1=>3, 6, 6, 1, 4, 0, 2, 5, 1, 3, 6, 1);
$numDays = array (1=>31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
//initialize build data...
$moStrt=$startDays[$mo2Use];
//Get the band data to display...
$qry="SELECT * FROM tblbands WHERE playMonth = '".$mo2Use."'";
$bands=mysql_query($qry, $theatre);
$bandsRow=mysql_fetch_assoc($bands);
//build calendar headers...
//Blah-de-blah...
/* Populate calendar...
$cdn = Current Day Number...
$w = week count
42 is the most day cells in any given calendar month - 7 days per week, 6 weeks per month.... */
$cdn=1;
$w=1;
for ($i=0; $i<42; $i++) {
//Open table cell...
print ("<td valign=\"top\">");
//Check to see if the current cell count is before the first day of the month or after the last - if so, print empty cell...
if(($i<$moStrt) || ($cdn>$numDays[$mo2Use])){
print " </td>\n";
} else {
//If cell counter is between first and last day of the month, print the day number in the cell...
print "$cdn";
do {
if($bandsRow['playDay'] == $cdn) {
print ("<br><a href=\"".$bandsRow['webLink']."\" target=\"_blank\">".$bandsRow['bandName']."<br>".$bandsRow['musicStyle']."</a></td>\n");
}else{
print "</td>";
}
} while ($bandsRow=mysql_fetch_assoc($bands));
$cdn++;
}
//If current week day counter is greater than 7, start a new row and reset week day counter...
if($w==7){
print("</tr>\n<tr class=\"calNums\" height=\"61\">\n");
$w=1;
} else {
//Increment week day counter...
$w++;
}
}
//Close the final row and table...
Now, it seems like it should work - and it does for the first item in the database that has a playDay value that matches $cdn. Anything beyond the first record, however, it totally ignores.
Any ideas?
:edit: I realized that I had the variable incorrect in my While statement. Now that I fixed it, the code doesn't output any data, regardless of the date. I broke it by fixing the variable. That stinks.
PS - Much thanks in advance for any and all help!