Skip to main content
Participant
June 19, 2018
Answered

Repeat Region Doubles Result.

  • June 19, 2018
  • 3 replies
  • 440 views

I have one record in a database and for some reason when I use the "repeat region" behavior it doubles the result ( 2 identical "TimeCardHistory" divs) . Im missing something rudimentary here.   

<body>

<div class="tcheader">

  <input type="hidden" name="empID"/>

  <div id="tcheadercell"><b><?php echo $row_getTimeCards['LastName']; ?>,<?php echo $row_getTimeCards['FirstName']; ?></b></div>

      <div id="tcheadercell">Regular Hours</div>

      <div id="tcheadercell">PTO</div>

      <div id="tcheadercell">STD</div>

      <div id="tcheadercell">Holiday</div>

      <div id="tcheadercell">Overtime</div>

      <div id="divHeaderSpacer"> </div>

      <div id="tcheadercell">Total Hours</div>

      <div id="tcheadercell">Weekly Average</div>

      <div id="tcheadercell">Daily Average</div>

      <div id="divHeaderSpacer"> </div>

      <div id="tcheadercell"><b>PTO</b></div>

      <div id="tcheadercell">Bal Forward</div>

      <div id="tcheadercell">Accrued</div>

      <div id="tcheadercell">Used</div>

      <div id="tcheadercell">Balance:</div>

      <div id="divHeaderSpacer"> </div>

      <div id="tcheadercell"><b>STD</b></div>

      <div id="tcheadercell">Bal Forward</div>

      <div id="tcheadercell">Accrued</div>

      <div id="tcheadercell">Used</div>

      <div id="tcheadercell">Balance:</div>

</div>

<?php do { ?>

  <div class="TimeCardHistory">

    <div id="dataHed"><b> <?php echo $row_getTimeCards['REG_TCD']; ?></b></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_HRS']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_PTO']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_STD']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_HOL']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_OVT']; ?></div>

    <div> </div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_TTL']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_WAV']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_DAV']; ?></div>

    <div> </div>

    <div> </div>

    <div id="dataSeg"><?php echo $row_getTimeCards['PTO_BAL_FWD']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['PTO_ACCRUED']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['PTO_USED']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['PTO_BAL']; ?></div>

    <div> </div>

    <div> </div>

    <div id="dataSeg"><?php echo $row_getTimeCards['STD_BAL_FWD']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['STD_ACCRUED']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['STD_USED']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['STD_BAL']; ?></div>

  </div>

  <?php } while ($row_getTimeCards = mysql_fetch_assoc($getTimeCards)); ?>

 

</body>

</html>

<?php

mysql_free_result($getTimeCards);

?>

Using DW 5 (11.0 build 4993)

Thanks!

J

This topic has been closed for replies.
Correct answer jormas55121586

Nevermind. It was an issue with my Query. NOT Dreamweaver.  Thanks for the time everyone!

3 replies

jormas55121586AuthorCorrect answer
Participant
June 19, 2018

Nevermind. It was an issue with my Query. NOT Dreamweaver.  Thanks for the time everyone!

WolfShade
Legend
June 19, 2018

I have no recent PHP knowledge, but I noticed that all of your divs have the same ID.  This doesn't affect your db issue, but all elements that have ID should have uinque IDs.

V/r,

^ _ ^

Participant
June 19, 2018

Nah...its all separate.

Legend
June 19, 2018

What happens if you set the loop up as below:

<?php while ($row_getTimeCards = mysql_fetch_assoc($getTimeCards)); { ?>

  <div class="TimeCardHistory">

    <div id="dataHed"><b> <?php echo $row_getTimeCards['REG_TCD']; ?></b></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_HRS']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_PTO']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_STD']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_HOL']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_OVT']; ?></div>

    <div> </div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_TTL']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_WAV']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['REG_DAV']; ?></div>

    <div> </div>

    <div> </div>

    <div id="dataSeg"><?php echo $row_getTimeCards['PTO_BAL_FWD']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['PTO_ACCRUED']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['PTO_USED']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['PTO_BAL']; ?></div>

    <div> </div>

    <div> </div>

    <div id="dataSeg"><?php echo $row_getTimeCards['STD_BAL_FWD']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['STD_ACCRUED']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['STD_USED']; ?></div>

    <div id="dataSeg"><?php echo $row_getTimeCards['STD_BAL']; ?></div>

  </div>

  <?php }  ?>

Nancy OShea
Community Expert
Community Expert
June 19, 2018

Deprecated Behavior Panels in older versions of DW should not be used on current projects.  The code is outdated, not secure and won't execute on servers with PHP 7 or higher.  Use at your own risk. A much better option would be to code your own with MySQLi or PDO.  Failing that, there are commercial extensions you can use from Web Assist or DMX Zone to replace the old database panels. 

Nancy O'Shea— Product User & Community Expert
Participant
June 19, 2018

Thanks for the reply but not helpful.

PS this is not a internet facing app.