Good Saturday afternoon to you all,
I am gathering data using the mysql_query and echoing it to the browser. The thing is in one of my MySQL columns the data entered is "ACR" or "TOY or "AUD". These should read "Acura," "Toyota" and "Audi".
How would I code it so ACR = Acura, TOY = Toyota and AUD = Audi. This would be echoed to the browser so the end user does not get the abbreviated version of the data?
This is the code I am working with now which out puts my data. The 'vehicles' is the column I need the name changes to be performed:
<?php
//Connect to the Database via the Include File!
require ('get_connected.php');
// Perform an statndard SQL query:
$res = mysql_query("SELECT UPPER(vehicle) AS vehicle, sub_class, disp, fuel FROM cars ORDER BY vehicle ASC") or die (mysql_error());
// Assuming $res holds the results from your query:
$class = 'even';
$current = '';
while($row = mysql_fetch_array($res)) {
if($current != $row['vehicle']) {
$current = $row['vehicle'];
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>";
}
$class = $class == 'even' ? 'odd' : 'even';
echo "<tr class=\"$class\">\n";
echo "<td>$row[sub_class]</td>\n";
echo "<td>$row[disp]</td>\n";
echo "<td>$row[fuel]</td>\n";
echo "</tr>\n";
}
?>
The above code echos the following table:
http://www.supermandatabase.com/arb/row.jpg
In every instance of the $current which takes the 'vehicle' column from MySQL, I need it to convert the data from ACR to ACURA, TOY to TOYOTA, etc.
Any suggestions?
Thanks in adavance.
Shannon