1 Reply Latest reply on Sep 11, 2008 10:47 AM by DdoubleU

    How can I use a Looper inside a Repeat Region?

    DdoubleU Level 1
      I have a Dreamweaver standard Repeat Region applied to a HTML table containing two horizontal loopers. The HTML table is to display a list of company contacts for our members. The loopers display find for the first company but after that they stop. To key the loopers to the company Im using a trick mentioned by Günter Schenk in this thread: http://www.adobeforums.com/webx/.59b524b4/5. He calls it a sub query; at times I use to help myself by using some sort of "sub query" like the following <br /> <br />Ive linked my looper recordset to the recordset used for the Repeat Region. Heres one of the looper queries: <br /> <br />$KTColParam1_rsContactFeatures = "-1"; <br />if (isset($_SESSION["kt_login_id"])) { <br />$KTColParam1_rsContactFeatures = $_SESSION["kt_login_id"]; <br />} <br />mysql_select_db($database_RNW, $RNW); <br />$query_rsContactFeatures = sprintf("SELECT DISTINCT list_feature.description_feature, company.id_company, contact_cnt.idpremissions_cnt FROM (((company LEFT JOIN company_to_feature ON company_to_feature.idcompany=company.id_company) RIGHT JOIN list_feature ON list_feature.id_list_feature=company_to_feature.idlistfeature) LEFT JOIN contact_cnt ON contact_cnt.idcompany_cnt=company.id_company) WHERE company.id_company='".$row_rsContactAll['id_company']."' AND company_to_feature.id_feature is not null AND contact_cnt.idpremissions_cnt=%s ORDER BY company.id_company ASC ", GetSQLValueString($KTColParam1_rsContactFeatures, "int")); <br />$rsContactFeatures = mysql_query($query_rsContactFeatures, $RNW) or die(mysql_error()); <br />$row_rsContactFeatures = mysql_fetch_assoc($rsContactFeatures); <br />$totalRows_rsContactFeatures = mysql_num_rows($rsContactFeatures); <br /> <br />This is my link in both quires: WHERE company.id_company='".$row_rsContactAll['id_company']."' <br /> <br />Heres the code for the connected looper: <br /> <br /><?php<br />do { // horizontal looper version 3<br />?> <br /> <br /> <br /> <br /> <br />As I said this works fine for the first item in the list but then it quits. Heres a screen shot of what I dont want: http://www.retirenw.com/images/help/looper_inside_repeat_region.gif <br /> <br />Is there anyway to change the php for the loopers to make this work? <br /> <br />Thanks for your help <table> <tr> <td> <img src="../images/bullet.gif" width="8" height="14" /> </td> <td> <?php echo $row_rsContactFeatures['description_feature']; ?> </td><?php <br />$row_rsContactFeatures = mysql_fetch_assoc($rsContactFeatures);<br />if (!isset($nested_rsContactFeatures)) { <br />$nested_rsContactFeatures= 1;<br />}<br />if (isset($row_rsContactFeatures) && is_array($row_rsContactFeatures) && $nested_rsContactFeatures++ % 1==0) {<br />echo "</tr><tr>";<br />}<br />} while ($row_rsContactFeatures); //end horizontal looper version 3<br />?> </tr> </table>