nested
I have a nested repeat region that was converted using databridge. The code produced is:
<?php
$master1events = new WA_MySQLi_RS("master1events",$clarion_i,0);
$master1events->setQuery("SELECT * FROM (events LEFT OUTER JOIN eventsDate ON events.events_ID=eventsDate.event_IDfk) GROUP BY event ORDER BY eventsDate.eventDate ASC LIMIT 0, 20");
$master1events->execute();
?>
<?php
$detail2eventsDate = new WA_MySQLi_RS("detail2eventsDate",$clarion_i,1);
$detail2eventsDate->setQuery("SELECT * FROM eventsDate WHERE event_IDfk=123456789 ORDER BY eventsDate.eventDate ASC ");
$detail2eventsDate->execute();
?>
<table border="0" cellpadding="0" cellspacing="0">
<?php
$wa_startindex = 0;
while(!$master1events->atEnd()) {
$wa_startindex = $master1events->Index;
?>
<tr>
<td><p class="event-title"><?php echo $master1events->getColumnVal('eventimg'); ?> <?php echo $master1events->getColumnVal('event'); ?></p>
<p class="event-desc"><?php echo $master1events->getColumnVal('desc_front'); ?></p></td>
</tr>
<?php
if ($master1events->TotalRows>0) {
$nested_query_detail2eventsDate = str_replace("123456789", $master1events->getColumnVal('events_ID'), $query_detail2eventsDate);
mysql_select_db($database_clarion);
$detail2eventsDate = mysql_query($nested_query_detail2eventsDate, $clarion) or die(mysql_error());
$row_detail2eventsDate = mysql_fetch_assoc($detail2eventsDate);
$detail2eventsDate->TotalRows = mysql_num_rows($detail2eventsDate);
$nested_sw = false;
if (isset($row_detail2eventsDate) && is_array($row_detail2eventsDate)) {
do { //Nested repeat
?>
<tr>
<td><p class="event-para"><strong><?php echo $detail2eventsDate->getColumnVal('location'); ?></strong>: <?php echo $detail2eventsDate->getColumnVal('dateDisplay'); ?>
<?php
// Show IF Conditional region1
if (@$detail2eventsDate->getColumnVal('link') != null) {
?>
<a href="<?php echo $detail2eventsDate->getColumnVal('link'); ?>">Read more</a>
<?php
// Show IF Conditional region1
if (@$detail2eventsDate->getColumnVal('regLink') != null) {
?>
| <a href="<?php echo $detail2eventsDate->getColumnVal('regLink'); ?>">Register</a>
<?php }
// endif Conditional region1
?>
<?php
// Show IF Conditional region5
if (@$detail2eventsDate->getColumnVal('online') == 1) {
?>
<em>(Online or In-person)</em>
<?php }
// endif Conditional region5
?>
</p>
<?php }
// endif Conditional region1
?></td>
</tr>
<?php
} while ($row_detail2eventsDate = mysql_fetch_assoc($detail2eventsDate)); //Nested move next
}
}
?>
<tr>
<td> </td>
</tr>
<?php
$master1events->moveNext();
}
$master1events->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</table>
The code does not work. Do I have to change the way the second recordset is setup? Maybe change event_IDfk=123456789?
Thanks for any help.