I have a table with dated news in it. I have a php calendar script with date of course. what I would like to do is to look at all the news I have and gather all theire date then if I have a new on a certain date I want to make a link on that date in my calendar. logic isn't it?
well so fare I have only managed to make all the date of the calendra linked or only the last news linked.
here is part of my script:
if ( intval($month_num) < 10) { $new_month_num = "0$month_num"; }
elseif (intval($month_num) >= 10) { $new_month_num = $month_num; }
if ( intval($day) < 10) { $new_day = "0$day"; }
elseif (intval($day) >= 10) { $new_day = $day; }
$link_date = "$year-$new_month_num-$new_day";
$query = "Select date from $table order by date";
$result = mysql_query($query);
while($row = mysql_fetch_row($result)){
$date = $row[0];
$d = explode("-",$date);
$dayx = $d[2];
$monthx = $d[1];
$yearx = $d[0];
$hour = $d[3];
$min = $d[4];
$thedate = "$yearx-$monthx-$dayx";
$total = $thedate;
if ($link_date == $thedate) {
$linkdd = "<a href=\"indexed.php?action=sdate&daten=$link_date\">$day</a>";
}
else{
$linkdd = "<p>$day</p>";
}
}
echo "<td class=\"day\"><center>$linkdd</center></td>";
with this script I get every thing working but only the last posted news is linked.
if I move the last ligne ech0"<td... just above th } signe I have all the news linked but I get each of the day as many time as there is news ( if I have 13 news I get 13 times each day).
Hope I'm clear
Q
so if anyone can help it would be cool ;o)