Ah, thought you might have done. However, it shouldn't be necessary - the line breaks shouldn't get added at all - content between code isn't supposed to be changed (excluding font/colour formatting).
Dunno what the cause is though - I did go look at the code Matt referred to and it's far too much effort trying to decipher it all, especially as tired as I currently am.
$sold1 = $row[sold]; if ($sold1 == yes){ $soldstring .= "<img alt=\"sold\" src=\"./photos/{$row[thumb]}\" />"; } else { $soldstring .= "<img alt=\"notsold\" src=\"./photos/{$row[thumb]}\" />"; }echoing
" . $soldstring . "This does as expected for the first result from the DB. But the next result contains the first image as well, and the next one the previous and so on.
$sold1 = $row[sold];
if ($sold1 == yes){
$soldstring = "<img alt=\"sold\" src=\"./photos/{$row[thumb]}\" />"; }
else {
$soldstring = "<img alt=\"notsold\" src=\"./photos/{$row[thumb]}\" />"; }