PHP elseif

Just had a question answered and it works, but I need to modify it and, as I said earlier, my PHP sucks.

Can someone take my attached code and work it so that the three nid (nodeID's) are all a part of a big elseif statement?
<?php
if ($node->nid == 90468) {
?>
    
    <div id='event-dates'>    
        <h2>Date</h2>    
        <table id="events-table" class="<?php print $class; ?>">
            <tr>    
                <th>Date</th>    
    
            </tr>    
            <tbody>    
            
                <tr id="services-row-0" class="class">
                 
                    <td>5/19/2011</td>
                 
                </tr>    
            
                </tbody>        
            </table>          
        </div>        
        
        
        
<?php
                } else {
?>
  
<?php } ?>


<?php
if ($node->nid == 90467) {
?>
    
    <div id='event-dates'>    
        <h2>Date</h2>    
        <table id="events-table" class="<?php print $class; ?>">
            <tr>    
                <th>Date</th>    
    
            </tr>    
            <tbody>    
            
                <tr id="services-row-0" class="class">
                 
                    <td>5/17/2011</td>
                 
                </tr>    
            
                </tbody>        
            </table>          
        </div>        
        
        
        
<?php
                } else {
?>
 <div id='event-dates'>                    
                        <h2>Date/Time</h2>                    
                        <table id="events-table" class="<?php print $class; ?>">
                            <tr>                    
                                <th>Date</th>                    
                                <th>Time</th>                    
                            </tr>                    
                            <tbody>                    
            <?php foreach ($instances as $count => $row): $class = ($count % 2) ? "odd" : ""; ?>
                        <tr id="services-row-<?php print $count ?>" class="<?php print $class; ?>">
                <?php foreach ($row as $field => $content): ?>
                            <td><?php print $content; ?></td>
                <?php endforeach; ?>
                        </tr>            
            <?php endforeach; ?>
        </tbody>
    </table>  
</div>
<?php } ?>


<?php
if ($node->nid == 90466) {
?>
    
    <div id='event-dates'>    
        <h2>Date</h2>    
        <table id="events-table" class="<?php print $class; ?>">
            <tr>    
                <th>Date</th>    
    
            </tr>    
            <tbody>    
            
                <tr id="services-row-0" class="class">
                 
                    <td>5/16/2011</td>
                 
                </tr>    
            
                </tbody>        
            </table>          
        </div>        
        
        
        
<?php
                } else {
?>
 <div id='event-dates'>                    
                        <h2>Date/Time</h2>                    
                        <table id="events-table" class="<?php print $class; ?>">
                            <tr>                    
                                <th>Date</th>                    
                                <th>Time</th>                    
                            </tr>                    
                            <tbody>                    
            <?php foreach ($instances as $count => $row): $class = ($count % 2) ? "odd" : ""; ?>
                        <tr id="services-row-<?php print $count ?>" class="<?php print $class; ?>">
                <?php foreach ($row as $field => $content): ?>
                            <td><?php print $content; ?></td>
                <?php endforeach; ?>
                        </tr>            
            <?php endforeach; ?>
        </tbody>
    </table>  
</div>
<?php } ?>

Open in new window

freezillaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rik-LeggerCommented:
<?php
if ($node->nid == 90468) {
?>
    
    <div id='event-dates'>    
        <h2>Date</h2>    
        <table id="events-table" class="<?php print $class; ?>">
            <tr>    
                <th>Date</th>    
    
            </tr>    
            <tbody>    
            
                <tr id="services-row-0" class="class">
                 
                    <td>5/19/2011</td>
                 
                </tr>    
            
                </tbody>        
            </table>          
        </div>        
        
        
        
<?php
                } elseif ($node->nid == 90467) {
?>
    
    <div id='event-dates'>    
        <h2>Date</h2>    
        <table id="events-table" class="<?php print $class; ?>">
            <tr>    
                <th>Date</th>    
    
            </tr>    
            <tbody>    
            
                <tr id="services-row-0" class="class">
                 
                    <td>5/17/2011</td>
                 
                </tr>    
            
                </tbody>        
            </table>          
        </div>        
        
        
        
<?php
                } elseif ($node->nid == 90466) {
?>
    
    <div id='event-dates'>    
        <h2>Date</h2>    
        <table id="events-table" class="<?php print $class; ?>">
            <tr>    
                <th>Date</th>    
    
            </tr>    
            <tbody>    
            
                <tr id="services-row-0" class="class">
                 
                    <td>5/16/2011</td>
                 
                </tr>    
            
                </tbody>        
            </table>          
        </div>        
        
        
        
<?php
                } else {
?>
 <div id='event-dates'>                    
                        <h2>Date/Time</h2>                    
                        <table id="events-table" class="<?php print $class; ?>">
                            <tr>                    
                                <th>Date</th>                    
                                <th>Time</th>                    
                            </tr>                    
                            <tbody>                    
            <?php foreach ($instances as $count => $row): $class = ($count % 2) ? "odd" : ""; ?>
                        <tr id="services-row-<?php print $count ?>" class="<?php print $class; ?>">
                <?php foreach ($row as $field => $content): ?>
                            <td><?php print $content; ?></td>
                <?php endforeach; ?>
                        </tr>            
            <?php endforeach; ?>
        </tbody>
    </table>  
</div>
<?php } ?>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
freezillaAuthor Commented:
Beautiful!  Now I have my Friday afternoon free!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.