I am using the following code to convert three digits from one filed in a tabel into actual words from another field in a different table. The outputed results are grouped together. I would like to be able to have the results formatted. This is hard to explain....but I will try.
Basically, the results I am currently getting look like this (These results are displayed by <? echo $display; ?> listed in the code below:
2 story New Englander Detached Full Unfinished Bulkhead Concrete Clapboard Shingle Oil Hot Air Wood Frame Electric 100 Amp Circuit Breaker Public Drilled Well Gravel Gravel Sloping Eat-in-Kitchen 1st Floor Laundry Deck Ceiling Fan Living Room Dining Room Kitchen 1/2 Bath Master Bedroom
I would like to be able to somehow have the code do the following:
Text I choose - 2 story
different text I choose - New Englander
different text I choose - Detached
different text I choose - Unfinished
etc...
How can I do this? It looks like I need to somehow put it in a table.
<?
$split_features = "$row[features]";
$i = 0;
?>
<?
for ($i = 0; $i <= 85; $i += 3)
{
?>
<?
$currCode = substr($split_features,$i ,3);
$query2="SELECT long_name, code FROM features WHERE code = '$currCode'";
$result2=mysql_query($query2) or die (mysql_error());
while ($row2 = mysql_fetch_array($result2)) // this will grab the results from query
$display = "$row2[long_name]";
?>
<? echo $display; ?>
<?
}
?>
<?
}
?>