I changed my database from mysql 4.1.10 to mysql 5.0 and I encountered error in my calendar event page. The output of my calendar date was change instead of date it becomes “>” and also when I press the button to move to another month I can’t move to another month. I have no idea why it happened.
Here is the old calendar code:
[php]
<?php $dbCnx = @mysql_connect("localhost","", "") or die('Could not Connect to the database') mysql_select_db("mydb"); ?> <?php $day = (isset($_GET["day"])) ? $_GET['day'] : ""; $month = (isset($_GET["month"])) ? $_GET['month'] : ""; $year = (isset($_GET["year"])) ? $_GET['year'] : ""; if(empty($day)){ $day = date("j"); } if(empty($month)){ $month = date("n"); } if(empty($year)){ $year = date("Y"); } $currentTimeStamp = strtotime("$year-$month-$day"); $monthName = date("F", $currentTimeStamp); $numDays = date("t", $currentTimeStamp); $counter = 0; function hiLightEvt($eMonth,$eDay,$eYear){ $todaysDate = date("n/j/Y"); $dateToCompare = $eMonth . '/' . $eDay . '/' . $eYear; if($todaysDate == $dateToCompare){ $aClass='class="today"'; }else{ $sql="select count(calDate) as eCount from calTbl where calDate = '" . $eMonth . '/' . $eDay . '/' . $eYear . "'"; $result = mysql_query($sql); while($row= mysql_fetch_array($result)){ if($row['eCount'] >=1){ $aClass = 'class="event"'; }elseif($row['eCount'] ==0){ $aClass ='class="normal"'; } } } return $aClass; } ?>);"> |
<?php echo $monthName . " " . $year; ?> |
);"> | ||||
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
"; } } if($counter % 7 == 0 ){ ?> | ||||||
><?=$i;?> | <?php } ?>
Event Listed
'; while($row = mysql_fetch_array($result)){ ?><?=$row['calName'];?>
<?=$row['calDesc'];?>Listed On: <?=$row['calStamp'];?> <?php } } } ?>
On my new codes I only change the codes for the connection of database like the “host”, ”username”, ”password”, ”database name”, “table name”.
Honestly, I have no idea why it happened after I change my database. Actually my tbluser was work so I connected in my database on my other webpage.
Any help is highly appreciated. Thank you in advance.