The “best” way (in my opinion) to prevent “spaghetti” style is to differentiate php and html like:
<?php
while($row = mysqli_fetch_array($result){
?>
<div class="imagem">
<img src="<?php echo $row['logo'];?>" width="180px">
</div>
<?php
}
Side note: Next time if your question have a code use the tools <>
(html/js) or {}
(php and others lang)
1
solved How to insert a div in PHP properly? [closed]