Hi all,
I am retrieving information from a database and need to have that information put onto a new line (<br>) depending on the location of the comma which seperates the different areas of the information.
Here is what is being retrieved
2.25 L 75 hp (56 kW) I4 petrol (1983–1985), 2.25 L 62 hp (46 kW) I4 diesel (1983), 2.5 L 68 hp (51 kW) I4 diesel (1984–1993), 2.5 L 83 hp (62 kW) I4 petrol (1985–1993), 2.5 L 85 hp (63 kW) I4 Turbodiesel (1986–1990), 3.5 L 113 hp (84 kW) V8 (1983–1986), 3.5 L 134 hp (100 kW) V8 (1986–1993)
Now, whenever a comma appears above, I need that to indicate the beginning of a new line.
So, any suggestions on how I do this? Please don't post code for me without an explanation of what is happening as then I won't be able to learn!!
Here is the code that is getting the information from the database
while($row=mysql_fetch_array($result))
{
echo "<tr>";
echo "</td><td valign=\"top\">";
echo "<span class='vehicle_table_big'>$row[manufacturer] $row[make] $row[model] $row[variant]</span><span class='vehicle_table_normal'>from $row[production_date_from] to $row[production_date_to]</span><br>";
echo "<span class='vehicle_table_cell_header'>Body Style </span>";
echo "<span class='vehicle_table_normal'>$row[body_style]</span><br>";
echo "<span class='vehicle_table_cell_header'>Engine Types </span>";
echo "<span class='vehicle_table_normal'>$row[engine]</span><br>";
echo "<span class='vehicle_table_cell_header'>Transmission </span>";
echo "<span class='vehicle_table_normal'>$row[transmission]</span><br>";
echo "<span class='vehicle_table_cell_header'>Wheelbase </span>";
echo "<span class='vehicle_table_normal'>$row[wheelbase]</span><br>";
echo "<span class='vehicle_table_cell_header'>Length </span>";
echo "<span class='vehicle_table_normal'>$row[length] </span>";
echo "<span class='vehicle_table_cell_header'>Width </span>";
echo "<span class='vehicle_table_normal'>$row[width] </span>";
echo "<span class='vehicle_table_cell_header'>Height </span>";
echo "<span class='vehicle_table_normal'>$row[height]</span><br>";
echo "<span class='vehicle_table_cell_header'>Curb Weight </span>";
echo "<span class='vehicle_table_normal'>$row[curb_weight]</span>";
echo "</td><td align=\"center\" valign=\"middle\">";
echo "<img border=\"1\" src=$row[photo] title=\"$row[manufacturer] $row[make] $row[model] $row[variant]\"></td>";}
echo "</tr>";
echo "</table>";
mysql_close($connect);