Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Repeating Region problem

New Here ,
Mar 15, 2012 Mar 15, 2012

I'm having a problem for the last 2 days that I can't seem to solve. In the picture below you'll see I used Repeat Region for "bigTitle". When I do this, the contents for description won't display. As a matter a fact, ANY dynamic text that goes under a repeat region won display. However, If I instead used repeat region on "description", both "bigTitle" and "bar" will display content just fine.

There seems to be a problem having dynamic text below the repeat region and not above. HELP! Thanks in advance. 

Screen Shot 2012-03-15 at 10.44.04 AM.png

TOPICS
Server side applications
773
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 15, 2012 Mar 15, 2012

The answer is in the code. Screen shots don't tell anything.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 15, 2012 Mar 15, 2012

php.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2012 Mar 16, 2012

I think I figured out what the problem is but not the solution. Here's the code(all of this is generated by DW):

<?php do { ?>

  <?php echo $row_rsAbout['bar']; ?>

  <?php } while ($row_rsAbout = mysql_fetch_assoc($rsAbout)); ?>

<?php echo $row_rsAbout['bigTitle']; ?>

<?php echo $row_rsAbout['description']; ?>

</body>

</html>

<?php

mysql_free_result($rsAbout);

?>

I'm using a repeat region on 'bar'. Below that is 'bigTitle' and 'description'. When you run the code it seems that after the browser runs thru the do..while section it stop running the rest of the queries. How can I fix this?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2012 Mar 16, 2012

>When you run the code it seems that after the browser

>runs thru the do..while section it stop running the rest of the queries.

First of all, to be clear, the browser isn't running any of this code. All server side code is run on the server - only the html is sent to the browser. The problem is that your title and description are outside the loop. Just put them inside and they will display

<?php do { ?>

  <?php echo $row_rsAbout['bar']; ?>

  <?php echo $row_rsAbout['bigTitle']; ?>

  <?php echo $row_rsAbout['description']; ?>

  <?php } while ($row_rsAbout = mysql_fetch_assoc($rsAbout)); ?>

</body>

</html>

<?php

mysql_free_result($rsAbout);

?>

If this doesn't produce the results you want, then you need to tell us what results you do want.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2012 Mar 16, 2012
LATEST

I figured out that problem and solved it. Bregent, Thanks for ALL your help. What I wrote wasn't very decriptive. What I was looking to do was only repeat 'bar' not the rest. The other 2 ('bigTitle' and 'description') should only display the first record.

I had done this before but forgot the ONE really important thing. When you create a new recordset and intend on using Repeat Region, you need to create a another recordset with a different name (still using the same table). Soon as I did this it worked exactly as I intended. Thanks again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines