close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


Auto increment a # in a repeat region

Thread began 11/05/2012 8:28 am by SPT | Last modified 11/05/2012 1:12 pm by SPT | 2190 views | 2 replies |


Auto increment a # in a repeat region

I am trying to make a slider that is connected to a recordset. However for each repeated region it needs to increment up one number.

Original code that needs to increment.
First slide needs to be:
<div id="p7HGMpn_1_1" class="p7HGM_panel">
<div id="p7HGMpc_1_1" class="p7HGM_panel_content">

The next slide repeated from the RS (and so on incrementing one number) needs to be:
<div id="p7HGMpn_1_2" class="p7HGM_panel">
<div id="p7HGMpc_1_2" class="p7HGM_panel_content">

I tried making a variable and placing it in the slide but no joy.
Here is how I tried:
My variable :
<?php $i = 1;?>
Then placed it:
<div id="p7HGMpn_1_<?php echo $I = $i + 1;?>" class="p7HGM_panel">
<div id="p7HGMpc_1_<?php echo $I = $i + 1;?>" class="p7HGM_panel_content">

Parsed code for every panel comes out:
<div id="p7HGMpn_1_2" class="p7HGM_panel">
<div id="p7HGMpc_1_2" class="p7HGM_panel_content">

I understand why it does not work but I can not figure out how to make it work.

Attached Files
Sign in to reply to this post

Jason ByrnesWebAssist

initialize the variable just before the do statement:

<?php i 1?>

do{ ?>

reference the $i variable in the ID's:

<div id="p7HGMpn_1_<?php echo $i?>" class="p7HGM_panel">

<div id="p7HGMpc_1_<?php echo $i?>" class="p7HGM_panel_content">

increment the variable just before the while statement using ++

<?php $i++ ?>

} while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?>
Sign in to reply to this post


OMG Jason you are my hero!!!!


Another really cool thing: I made the page with just the slider and nothing else then used Framework to drop it into a page and it worked mint! 2 clicks and Done.

Where would I be without my WA. :)

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...