Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 571267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:29:21+00:00 2026-05-13T13:29:21+00:00

I have a table listing several elements, and their expiration date. I need a

  • 0

I have a table listing several elements, and their expiration date.

I need a function that says, “If the expiration date is later than today (for each element), then don’t show”.

It seems pretty simple, but I’m stuck!


Edit

<?php foreach($codes->result_array() as $row):?>
<tr>
    <td><?php print $row['description']?></td>
    <td><?php print $row['credits']?></td>
    <td><?php print $row['code']?></td>
    <td><? echo date("F jS, Y", strtotime($row['exp_date']));?></td>
    <td><? echo date("F jS, Y", strtotime($row['create_date']));?></td>
    <td>
        <!-- Icons -->
         <a href="<? echo base_url()?>admin/home/editCode/<?php print $row['id']?>" title="Edit"><img src="<? echo base_url()?>assets/images/icons/pencil.png" alt="Edit" /></a>
         <a href="<? echo base_url()?>admin/home/deleteCode/<?php print $row['id']?>" title="Delete" class="delete-code"><img src="<? echo base_url()?>assets/images/icons/cross.png" alt="Delete" /></a> 
    </td>
<?php endforeach;?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:29:21+00:00Added an answer on May 13, 2026 at 1:29 pm

    Seperate your concerns will help you see your question clearer.

    In your controller:

    <?php
    $result_array = $codes->result_array();
    $results = array();
    $today = time();
    
    foreach($codes->result_array() as $row)
    {
        if(strtotime($row['exp_date']) <= $today)
        {//-- Keep this
            $results[] = $row;
        }
    }
    ?>
    

    In your view:

    <?php foreach($results as $result): ?>
    <tr>
        <td><?php print $result['description']?></td>
        <td><?php print $result['credits']?></td>
        <td><?php print $result['code']?></td>
        <td><? echo date("F jS, Y", strtotime($result['exp_date']));?></td>
        <td><? echo date("F jS, Y", strtotime($result['create_date']));?></td>
        <td>
            <!-- Icons -->
             <a href="<? echo base_url()?>admin/home/editCode/<?php print $result['id']?>" title="Edit"><img src="<? echo base_url()?>assets/images/icons/pencil.png" alt="Edit" /></a>
             <a href="<? echo base_url()?>admin/home/deleteCode/<?php print $result['id']?>" title="Delete" class="delete-code"><img src="<? echo base_url()?>assets/images/icons/cross.png" alt="Delete" /></a> 
        </td>
    <?php endforeach;?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table listing people along with their date of birth (currently a
I currently have a table listing all of the products that are in the
I have a calendar_date_select in a view that shows a table listing all the
I have a table that holds listing information for housing properties. A property may
I have a table in SQL Server listing corporate departments and their sections and
The problem: I have an inventory table, and a table listing items that are
I have a table in MySQL with a date column, listing the date the
Need to find records in subinv that do NOT have a listing in subinv
I have table with some fields that the value will be 1 0. This
I have a SQLite database, and several tables within that datbase. I am developing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.