我想将日历显示为特定月份的数据,它显示了该月的所有数据。
假设,我的数据库中有数据作为..
Jan=124; Jan=243; Jan=354
Feb=978; Feb=765; Feb=756;
它可以是:
Jan,2013
124
243
354
Feb,2013
978
765
756
我做了这个代码:
<?php
$q2="select * from calendar";
$res2=mysql_query($q2);
$row2=mysql_fetch_assoc($res2);
$mnth = array('Jan','Feb');
$j= count($mnth);
for ($i=0; $i<= $j; $i++){
if($row2['month']=='June'){
?><tr><td><?php
echo $row2['month']; ?> , <?php echo $row2['year'];
?></td></tr><tbody><div><?php
include("connection.php");
$q1="select * from calendar";
$res=mysql_query($q1);
while($row=mysql_fetch_assoc($res)){
?><tr><td><?php
echo $row['dates'];
?></td></tr></tbody></div><?php
}
}
}