AislanFane esta ai o codigo q você precisaa!!! estava sofrendo também enfim conseguii <?php
include "login/conectar.php";
<style type="text/css">
.tabela {
float: left;
position: relative;
}
</style>
$sql = ("SELECT * FROM imoveis ORDER BY id DESC LIMIT 9");
$resultado = mysql_query($sql)
or die ("Não foi possível realizar a consulta");
if (@mysql_num_rows($resultado) == 0)
die('Nenhum registro encontrado');
?>
<table width="800" border="0" cellspacing="0" cellpadding="0" align="center"> <?php // Aqui no width você define o tanto de imagem q você quer q apareca ( na minha esta para aparecer 8 ) ?>
<tr>
<td>
<?php
while ($linha = mysql_fetch_array($resultado))
{
$id = $linha["id"];
?>
<table class="tabela" width="100" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width="50" height="50" align="center"><a href=visualizar.php?id=<?php echo $id; ?>><img border='0' width='100' height='100' src='login/fotos/".<?php echo $linha[foto]; ?>."'/></a></td>
</tr>
</table>
<?php
}
?>