// Draw data from database
mysql_select_db($database_MyCalendar, $MyCalendar);
$query_Rec_set_1 = "SELECT COUNT(*) FROM data WHERE data.y_from = $year AND data.n_from = $month AND data.d_from = $date_index";
$Rec_set_1 = mysql_query($query_Rec_set_1, $MyCalendar) or die(mysql_error());
$row_Rec_set_1 = mysql_fetch_assoc($Rec_set_1);
$totalRows_Rec_set_1 = mysql_num_rows($Rec_set_1);
$count = mysql_result($Rec_set_1,0,0);
if ($count == 0) {
echo "<tr><td class=$class align=\"center\"><a href=\"data.php?c_date=$date_index&c_month=$month&c_year=$year\">$date_index</a></td>
<td class=$class><a href=\"data.php?c_date=$date_index&c_month=$month&c_year=$year\"><img src=\"images/day$day_index.gif\" border=\"0\"></a></td>
<td> </td></tr>";
// <td class=$class align=\"center\"><a href=\"data.php?c_date=$date_index&c_month=$month&c_year=$year\">$date_index</a></td>
} else {
echo "<tr><td class=$class align=\"center\"><a href=\"data.php?c_date=$date_index&c_month=$month&c_year=$year\">$date_index</a></td>
<td class=$class><a href=\"data.php?c_date=$date_index&c_month=$month&c_year=$year\"><img src=\"images/day$day_index.gif\" border=\"0\"></a></td>
<td>";
do {
$i++;
mysql_select_db($database_MyCalendar, $MyCalendar);
$query_Rec_set_2 = "SELECT * FROM `data` WHERE `data`.y_from = $year AND `data`.n_from = $month AND `data`.d_from = $date_index ORDER BY `data`.h_from, `data`.i_from";
$Rec_set_2 = mysql_query($query_Rec_set_2, $MyCalendar) or die(mysql_error());
$row_Rec_set_2 = mysql_fetch_assoc($Rec_set_2);
$totalRows_Rec_set_2 = mysql_num_rows($Rec_set_2);
// Draw the data
// echo " = $i";
// if data avaible
$from_time = $row_Rec_set_2['h_from'].":".$row_Rec_set_2['i_from'];
$to_time = $row_Rec_set_2['h_to'].":".$row_Rec_set_2['i_to'];
$note = $row_Rec_set_2['text'];
$post_h = $row_Rec_set_2['total_h'];
$post_m = $row_Rec_set_2['total_m'];
$post_time = $post_h + ($post_m/60);
$total_time = $total_time + $post_time;
$open = $row_Rec_set_2['open'];
if ($open == 1) {
$open = " ÖPPEN TID";
}
echo "
<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
<tr>
<td class=\"daynote\">Från: $from_time - $to_time > $note <font color=\"#990000\">($post_time h)</font>$open | </td>
</tr>
</table>
";
// go to nex rec
😕
What CODE shall i have here to get data for the next task whit same date?
// END Draw the data
} while ($i < $count);
$i = 0;
echo "</td></tr>";
}