intanto il tuo output non sarà quello che dici te
[img]foto/fotocarica1.jpg[/img],
[img]foto/fotocarica2.jpg[/img],
[img]foto/fotocarica3.jpg[/img],
ma eventualemnte sarà
[img]foto/fotocarica1.jpg[/img];
[img]foto/fotocarica2.jpg[/img];
[img]foto/fotocarica3.jpg[/img];
cmq supponiamo che tu vogli la , puoi anche fare anche così
Codice PHP:
<?php
out="";
$query=mysql_query("Select * from tabella where tipo = 1 order by id desc limit 3");
while($array=mysql_fetch_array($query)){
out.="<img src=\"$percorso".$array['foto']."\" alt=\"Img\" />,";
}
out= substr(out,0,-1);
echo out;
?>