Welcome Guest, Not a member yet? Register   Sign In
sub query problems SOLVED
#14

[eluser]srpurdy[/eluser]
View File Example
Code:
<?php foreach($show_champ as $mc):?>
<?php endforeach;?>
<?php if(!$show_champ):?>
<p>No data exists for this championship yet!</p>
&lt;?php else:?&gt;
&lt;?php if($mc->team_pts == 'F' AND $mc->teams == 'Y' OR $mc->teams == 'N'):?&gt;
&lt;?php if($mc->multi_class == '1'):?&gt;
<h4>&lt;?=$mc->car_name?&gt;</h4>
    <table id="champlist" class="tablesorter">

        <thead>
            <tr>
                <th>Pos.</th>
                <th>Driver</th>
                <th>Pts</th>
                &lt;?php if($mc->drop_mode == 'ON'):?&gt;
                <th>Pts Total</th>
                &lt;?php endif;?&gt;
                <th>Behind</th>
                <th>S</th>
                <th>P</th>
                <th>W</th>
                <th>T5s</th>
                <th>Avg S</th>
                <th>Avg F</th>
                <th>Laps</th>
                <th>LL</th>
                <th>Pole%</th>
                <th>Win%</th>
                <th>LL%</th>
                <th>Miles</th>
                <th>KM</th>
                <th>Inc/R</th>
                <th>Inc</th>
                <th>CPI</th>
            </tr>
        </thead>

        <tbody>
            &lt;?php
            $count = '1';
            ?&gt;
            &lt;?php foreach($show_champ as $ch):?&gt;
            <tr>
                <td>&lt;?=$count++?&gt;</td>
                <td>&lt;?=$ch->driver_title?&gt;</td>
                <td>&lt;?=/*$dp->points;*/$ch->champ_points?&gt;</td>
                &lt;?php if($mc->drop_mode == 'ON'):?&gt;
                <td>&lt;?=$ch->champ_points + $ch->drop_total?&gt;&lt;?//=$add;?&gt;</td>
                &lt;?php endif;?&gt;
                <td>&lt;?$behind = $ch->champ_points - $pts_total_nmc?&gt;&lt;?=$behind?&gt;</td>
                <td>&lt;?=$ch->starts_total?&gt;</td>
                <td>&lt;?=$ch->poles_total?&gt;</td>
                <td>&lt;?=$ch->wins_total?&gt;</td>
                <td>&lt;?=$ch->top5_total?&gt;</td>
                <td>&lt;?=number_format($ch->avg_s_total, 1)?&gt;</td>
                <td>&lt;?=number_format($ch->avg_f_total, 1)?&gt;</td>
                <td>&lt;?=$ch->laps_total?&gt;</td>
                <td>&lt;?=$ch->led_total?&gt;</td>
                <td>&lt;?php if($ch->poles_total == 0):?&gt;0%&lt;?php else:?&gt;&lt;?$pole_perc = $ch->poles_total / $ch->starts_total?&gt;&lt;?$p_p = $pole_perc * 100; $p_p_result = number_format($p_p, 1);?&gt;&lt;?=$p_p_result?&gt;%&lt;?php endif;?&gt;</td>
                <td>&lt;?php if($ch->wins_total == 0):?&gt;0%&lt;?php else:?&gt;&lt;?$win_perc = $ch->wins_total / $ch->starts_total?&gt;&lt;?$w_p = $win_perc * 100; $w_p_result = number_format($w_p, 1);?&gt;&lt;?=$w_p_result?&gt;%&lt;?php endif;?&gt;</td>
                <td>&lt;?php if($ch->led_total == 0):?&gt;0%&lt;?php else:?&gt;&lt;?$ll_perc = $ch->led_total / $ch->laps_total?&gt;&lt;?$ll_p = $ll_perc * 100; $ll_p_result = number_format($ll_p, 1);?&gt;&lt;?=$ll_p_result?&gt;%&lt;?php endif;?&gt;</td>
                <td>&lt;?=$ch->miles_total?&gt;</td>
                <td>&lt;?=$ch->km_total?&gt;</td>
                <td>&lt;?php if($ch->inc_total == 0):?&gt;0.0&lt;?php else:?&gt;&lt;?$inc_per_race = $ch->inc_total / $ch->starts_total?&gt;&lt;?=number_format($inc_per_race, 1)?&gt;&lt;?php endif;?&gt;</td>
                <td>&lt;?=$ch->inc_total?&gt;</td>
                <td>&lt;?$cpi = $ch->turns * $ch->laps_total?&gt;&lt;?php if($ch->inc_total == 0):?&gt;&lt;?=@number_format($cpi, 1, '.', '')?&gt;&lt;?php else:?&gt;&lt;?=@number_format($cpi / $ch->inc_total, 1, '.', '')?&gt;&lt;?php endif;?&gt;</td>
            </tr>
            &lt;?php endforeach; ?&gt;
        </tbody>

    </table>
&lt;?php endif;?&gt;

So basically a new table, the drop total gets inserted into that table so I can join that with my championship to display the points with the drop races. Maybe this will come in handy for someone for something else.


Messages In This Thread
sub query problems SOLVED - by El Forum - 04-27-2010, 10:48 PM
sub query problems SOLVED - by El Forum - 04-28-2010, 02:49 AM
sub query problems SOLVED - by El Forum - 04-28-2010, 08:48 AM
sub query problems SOLVED - by El Forum - 04-28-2010, 03:18 PM
sub query problems SOLVED - by El Forum - 05-01-2010, 06:00 PM
sub query problems SOLVED - by El Forum - 05-02-2010, 06:10 PM
sub query problems SOLVED - by El Forum - 05-04-2010, 09:28 AM
sub query problems SOLVED - by El Forum - 05-08-2010, 01:45 PM
sub query problems SOLVED - by El Forum - 05-10-2010, 11:28 AM
sub query problems SOLVED - by El Forum - 05-10-2010, 11:37 AM
sub query problems SOLVED - by El Forum - 05-10-2010, 11:57 AM
sub query problems SOLVED - by El Forum - 06-07-2010, 06:06 AM
sub query problems SOLVED - by El Forum - 06-07-2010, 06:11 AM
sub query problems SOLVED - by El Forum - 06-07-2010, 06:11 AM
sub query problems SOLVED - by El Forum - 06-07-2010, 07:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB