Ignore most current upload

7 posts by 2 authors in: Forums > CMS Builder
Last Post: September 5, 2014   (RSS)

Hey Zicky, 

The simplest solution would be to not display the first record when you're looping through them:

<?php foreach($records as $key => $record): ?>
  <?php if($key == 0){ continue; } ?>

  //DISPLAY CONTENTS OF RECORDS HERE

<?php endforeach; ?>

So this code will loop through a list of items in an array (I'm assuming you're getting the records using the getRecords function). But if the item has a key of 0 (ie, it's the first in the list), it will not be displayed.

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Mikey - September 4, 2014

Hey Greg - thanks for the suggestion. Something happening, as it's removing all the records, not just the latest record. I've tried a few different configurations on your code and browsed the forum for tips that may help me get this figured out with no luck.

I am using the getRecords function.

Hi Zicky,

Would it be possible to post/attach the code you've got so far so I can see what might be causing the issue?

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Mikey - September 5, 2014

Greg - can I email it to you instead?

Sure thing, if you e-mail support@interactivetools.com I'll take a look for you.

Greg Thomas







PHP Programmer - interactivetools.com

By Mikey - September 5, 2014

Thanks Greg!

You're the man! It's working like a charm.
Thanks for the help.

Zick