How do I filter date fields for creating a nested repeat region
I've got a list with dates and a list with events haveing some of the same dates that are inside the dates list. Now I'd like to create a nested repeat that filters the dates not the IDs of the two tables. The following code (see below) works for ID-Filtering but not for date-filtering:
The "filtering-line" works for IDs:
$nested_query_rsRes_reservationen = str_replace("123456789", $row_rsRes_datum['DATUMID'], $query_rsRes_reservationen);
But not for dates
$nested_query_rsRes_reservationen = str_replace("123456789", $row_rsRes_datum['date'], $query_rsRes_reservationen);
Any ideas how this could work?
Also I can't get this similar code block work for dates:
$query_Recordset1 = "SELECT * FROM res_reservationen WHERE res_reservationen.ResDatum = ".$row_rsDatum['Datum']."";
but it works for IDs:
$query_Recordset1 = "SELECT * FROM res_reservationen WHERE res_reservationen.DATUMID = ".$row_rsDatum['DATUMID']."";
Are there any conversions I'm missing here? THANKS for any help!!
-----
<table border="1">
<?php do { ?>
<tr>
<td><?php echo $row_rsRes_datum['Datum']; ?></td>
<td><?php
if ($totalRows_rsRes_datum>0) {
$nested_query_rsRes_reservationen = str_replace("123456789", $row_rsRes_datum['DATUMID'], $query_rsRes_reservationen);
mysql_select_db($database_infra_mysqldb1);
$rsRes_reservationen = mysql_query($nested_query_rsRes_reservationen, $infra_mysqldb1) or die(mysql_error());
$row_rsRes_reservationen = mysql_fetch_assoc($rsRes_reservationen);
$totalRows_rsRes_reservationen = mysql_num_rows($rsRes_reservationen);
$nested_sw = false;
if (isset($row_rsRes_reservationen) && is_array($row_rsRes_reservationen)) {
do {
?>
<?php
if (!isset($nested_sw) || $nested_sw == false) {
$nested_sw = true;
} else {
?>
,
<?php
}
?>
<?php echo $row_rsRes_reservationen['ResDatum']; ?>
<?php
} while ($row_rsRes_reservationen = mysql_fetch_assoc($rsRes_reservationen));
}
}
?></td>
</tr>
<?php } while ($row_rsRes_datum = mysql_fetch_assoc($rsRes_datum)); ?>
</table>
-----