Jump to content

Repeat region help needed


stitchmedia

Recommended Posts

Hi, I'm afraid I'm quite new to PHP so please go easy on me  :shy:

 

I have the following code in my page which helps me to parse BbCode from a database field:

 

<?php
include('bbcode.php');
$bbcode = new bbcode;
$blogoutput = $row_Blogs['Content'];
$bbcode->parse($blogoutput);
?>

 

I then echo out the result further down the page with this code:

 

<?php echo $bbcode->parse($blogoutput); ?>

 

This line of code sits inside a repeat region that echo's out multiple divs with the content from each row.

 

Now on a page without a repeat region this works fine but I cant get it to work with the repeat region, it just outputs the same record each time.  I understand why its not working but unfortunately I lack the coding knowledge to rectify it.

 

This is the code for the DIV the repeat region applies to:

 

<form action="" method="get" name="BlogEntry">
                  <div id="blogbox">
                    <table width="100%" border="0">
                      <tr>
                        <td width="63%" valign="middle"><h1><?php echo $row_Blogs['Title']; ?>
                          <input name="BlogID" type="hidden" id="BlogID" value="<?php echo $row_Blogs['BlogID']; ?>" />
                        </h1>                        </td>
                        <td width="37%" valign="middle"> <a href="editblog.php?BlogID=<?php echo $row_Blogs['BlogID']; ?>"><img src="images/edit.gif" alt="Edit Blog" border="0" align="middle" /></a>  <input name="Delete" type="image" id="Delete" value="Delete" src="images/stddeletebutton.gif" align="middle" /></td>
                      </tr>
                      <tr>
                        <td colspan="2"><span class="style1">Posted by <a href="userprofile.php?UserID=<?php echo $row_Blogs['UserID']; ?>"><?php echo $row_Blogs['Username']; ?></a> on <?php echo $row_Blogs['DateCreated']; ?></span></td>
                      </tr>
                      <tr>
                        <td colspan="2" style="padding-top:5px;"><?php echo $bbcode->parse($blogoutput); ?></td>
                      </tr>
                    </table>
                  </div>
                  </form>
                  <?php } while ($row_Blogs = mysql_fetch_assoc($Blogs)); ?>

 

If you need any more info or more of the page code let me know.

 

Thanks

 

Dave

Link to comment
https://forums.phpfreaks.com/topic/194846-repeat-region-help-needed/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.