PDA

View Full Version : [PHP] repeat region



alapimba
May 6th, 2005, 02:11 PM
Hello,

i'm building a site with php in dreamweaver but i'm with a problem

when i use the repeat region server behaviour i can't use dynamic text anymore.
I mean let's imagine that i have on the left a repeat region behaviour of news with links to the complete new. and on the right of the site i want to display the new.. but it don't appear.

i'm using data from a mysql db.

this is the code i'm using to repeat region:


<?php do { ?>
<span class="titulo_not"><?php echo $row_rs_news['titulo']; ?></span> <a href="../noticias.php"><img src="../img/lupa.gif" width="11" height="10" border="0"></a><br>
<span class="data"><?php echo $row_rs_news['data']; ?><br>
<br>
</span>
<?php } while ($row_rs_news = mysql_fetch_assoc($rs_news)); ?>

and this is for the dynamic field alone without repeat:

<?php echo $row_rs_news['texto']; ?></p>

Anyone can help me?

opel
September 21st, 2006, 06:33 PM
have you tried renaming the repeat regions separately? dreamweaver usually names it repeatregion1 by default, use find/replace to change it.

bwh2
September 21st, 2006, 07:24 PM
i don't know wtf repeat region is, but i would try something like

<?php
$result = mysql_query( "SELECT ... " );
while( $row_rs_news = mysql_fetch_array( $result ) ) { ?>
<span class="titulo_not"><?php echo $row_rs_news['titulo']; ?></span> <a href="../noticias.php"><img src="../img/lupa.gif" width="11" height="10" border="0"></a><br>
<span class="data"><?php echo $row_rs_news['data']; ?><br>
<br>
</span>
<?php } while ($row_rs_news = mysql_fetch_assoc($rs_news)); ?>

opel
September 22nd, 2006, 03:32 AM
ok thanks for your help

bwh2
September 22nd, 2006, 03:36 AM
did that work? if not, show me your query statement and how you're throwing the result set into an associative array.