I am doing a simple query to retrieve car manufacturers from my db:
$result = mysql_query("SELECT DISTINCT model_make_display_name FROM car_query_models_full ORDER By model_make_display_name ASC") or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
echo "<p>".$row['model_make_display_name']."</p>\n";
}
The data is appearing as normal in HTML view, however when I view source some of the results are appearing like so:
<p>Ariel
</p>
<p>Armstrong </p>
<p>Ascari
</p>
<p>Aston Mart</p>
<p>Audi
</p>
<p>Austin
</p>
<p>Austin Hea</p>
<p>Autobianch</p>
<p>Auverland
</p>
<p>Avanti
</p>
<p>Beijing
</p>
<p>Bentley
</p>
Notice some of the names are adding a break after the text forcing the closing p tag to go onto next line, what could be causing this?
Cheers
Have you checked for newline characters on the ends of those manufacturers? Try
to see if they’re present. If so, simply cleanse the database (on entry or one-time) and you’ll be good to go.