Announcement

Collapse
No announcement yet.

Deleting or not showing item in php/mysql.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deleting or not showing item in php/mysql.

    I have an online calendar script that displays an ordered list of

    upcoming events. The problem is that the past items are not falling

    off after the event date. How do I write the script to only show

    events that have not happened yet, or set the database to delete the

    item all together? I believe that has something to do with

    "Operations/Triggers". As far as what the script looks like, here

    is a snippet:
    PHP Code:
    <?php
                
                
    echo '<ul class="thumbnails">';
                
                for(
    $i=0$i<count($events); $i++) {
                    
    $id $events[$i]['id'];
                    
    $date $events[$i]['date'];
                    
    $why $events[$i]['why'];
                    
    $address $events[$i]['address'];
                    
    $background $events[$i]

    [
    'background'];
                    
    $invited_friends $events[$i]

    [
    'invited_friends'];
                    
                    
    $bg_link =

    'include/graph/backgrounds/'.$GLOBALS['backgrounds'][$background]

    [
    'image'];
                    
                    echo 
    '<li class="span5">';
                        echo 
    '<div

    class="event_item">'
    ;
                            echo 
    '<a

    href="event.php?id='
    .$id.'">';
                            if(
    $GLOBALS

    ['backgrounds'][$background]['image']!='') echo '<img src="'.

    $bg_link.'" style="width:110px; height:80px; float:left; margin-

    right:10px; border: 1px solid #e5e5e5; margin:4px;"></a>'
    ;
                            echo 
    '<div>';
                            if(
    $why!='') echo

    '<a href="event.php?id='.$id.'">'.$why.'</a><br>';
                            if(
    $date!='') echo

    '<b>'.$date.'</b><br>';
                            if(
    $address!='')

    echo 
    $address.'<br>';
                            echo 
    '</div>';
                            echo 
    '<div

    style="clear:both;"></div>'
    ;
                        echo 
    '</div>';
                    echo 
    '</li>';
                }
                
                echo 
    '</ul>';
                
                if(
    count($events)==0) echo 'No coming

    events'
    ;
                
    ?>
    EDIT: You can see it in action at: RegisteredEvents dot Com
Working...
X