Good Morning,
Right now I have a table being echoed that has three columns: division, fuel and disp. On the mysql end I have about 2000 vehicles. Some 2007 and some 2008. The year data is already in the table but I would like to only echo the 2007 vehicles. Does anyone no how I can exclude the 2008 or have it only include the 2007? Would this be done on via the mysql_query?
Here is the code I am working with:
<?php
//Connect to the Database via the Include File!
require ('get_connected.php');
// Perform a statndard SQL query:
$res = mysql_query("SELECT UPPER(division) AS division, sub_model, disp, fuel FROM vlist_2007 ORDER BY division ASC") or die (mysql_error());
// Convert the Array DIVISION to Full Names
$makes = array('ACUR'=>'ACURA',
'ALP'=>'ALPINA',
'ASMA'=>'ASMA',
'AUDI'=>'AUDI');
print $makes[$row['division']];
//CSS for the Alternating Color Rows
$class = 'even';
//Convert DIVISION Column to out put from the MySQL instead of HTML
$current = '';
while($row = mysql_fetch_array($res)) {
if($current != $row['division']) {
$current = $row['division'];
echo "<table width='100%' border='0' bgcolor=#CCCCCC cellpadding='1' cellspacing='1'>
<tr>
<td width='110'><b>$makes[$current]</b></td>
<td width='110'><b>FUEL</b></td>
<td width='110'><b>DISPLACEMENT</b></td>
</tr>";
}
//Continuation of CSS for the Alternating Color Rows
$class = $class == 'even' ? 'odd' : 'even';
//Populate the Tables from the Database
echo "<tr class=\"$class\">\n";
echo "<td>$row[sub_model]</td>\n";
echo "<td>$row[disp]</td>\n";
echo "<td>$row[fuel]</td>\n";
echo "</tr>\n";
}
?>
Thank you in advance for any help or suggestions.
Shannon