close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How do I show the row number in a repeating table?

Thread began 5/31/2013 10:20 am by swolock397582 | Last modified 5/31/2013 12:32 pm by Jason Byrnes | 1007 views | 3 replies |

swolock397582

How do I show the row number in a repeating table?

I've seen this http://www.webassist.com/forums/posts.php?id=5919 but I don't get it. I'd like to have this:

1 | content from the first row
2 | content from the second row
3 | content from the third row
etc.

I tried this <?php $rowcount = 0; ?> outside the loop and <?php echo ++$rowcount; ?> in a cell within the repeating table. But it renumbers each page. If I have 10 pages of records with 10 records per page, it numbers 1 through 10 on each page instead of 1-10, 11-20, 21-30 etc.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

when you use the navigation to change the page, there should be a URL Variable to tell what page to load, for example:
on my items_results page, the URL variable looks like this:

items_results.php?pageNum_WADAitems=1&totalRows_WADAitems=14

pageNum_WADAitems=1 tells it to load page one.

Use this in an if statement when setting the row count:
<?php
$rowcount = 0;
if(isset($_GET['pageNum_WADAitems'])) $rowcount = intval($_GET['pageNum_WADAitems']) * 10;
?>

Sign in to reply to this post

swolock397582

Perfecto! Thanks.

For others, above the do loop put the following where 'items' is the name of your table. It's what shows up in the URL on other than the first page like 'pageNum_WADAbooks' or 'pageNum_WADAinventory'.

<?php
$rowcount = 0;
if(isset($_GET['pageNum_WADAitems'])) $rowcount = intval($_GET['pageNum_WADAitems']) * 10;
?>

In an empty column in the repeating table put <?php echo ++$rowcount; ?>

Jason, is the above correct? I wouldn't want to steer anyone in the wrong direction.

Sign in to reply to this post

Jason ByrnesWebAssist

yes, thats correct.

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

Content

rating

Layout

rating

Ease of use

rating

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...