Repetindo os resultados no "Search"
há algum problema no codigo da tabela
mas nao consigo acha-lo de jeito nenhum!
SS:
/applications/core/interface/imageproxy/imageproxy.php?img=http://img27.imageshack.us/img27/5898/testevq.png&key=45e67b723918f28cf2cd3cc8aca40f5b97503634a897c7a3091d75ede830f634" alt="testevq.png" />
____________________________________________________________________
Como voces podem ver, ele repete os resultados apenas na tabela.
CODIGO:
<?php
include "connection.php";
?>
<html>
<head>
<title>Resultados de pesquisa</title>
</head>
<body>
<?php
$buscar=$_POST['buscar'];
$sql= mysql_query("SELECT * FROM tabelas WHERE tabelas.nome LIKE '%".$buscar."%'");
$row = mysql_num_rows($sql);
if($row > 0) {
while($linha = mysql_fetch_array($sql)) {
$codigo = $linha['codigo'];
$local = $linha['local'];
$descricao = $linha['descricao'];
$valor = $linha['valor'];
$telefone = $linha['telefone'];
$codigo = $linha['codigo'];
echo "<strong>Codigo: </strong>".@$codigo;
echo "<br /><br />";
echo "<strong>Local: </strong>".@$local;
echo "<br /><br />";
echo "<strong>Descricao: </strong>".@$descricao;
echo "<br /><br /><hr />";
}
} else {
echo "Desculpe, nao encontramos nenhum registro.";
}
?>
<table width="611" border="1">
<tr>
<td width="83" align="center"><strong>Codigo</strong></td>
<td width="288" align="center"><strong>Endereco do imovel</strong></td>
<td width="107" align="center"><strong>Preco</strong></td>
<td width="105" align="center"><strong>Telefone</strong></td>
</tr>
<?php for($i=0;$i<$row;$i++){ $linha = mysql_fetch_assoc($sql); ?>
<?php if($row > 0) { ?>
<tr>
<td><?php echo $codigo ?></td>
<td><?php echo $local ?></td>
<td>R$ <?php $valor ?></td>
<td><?php echo $telefone ?></td>
<?php } ?>
<?php } ?>
</tr>
</table>
</tr>
</table>
<p> </p>
<p><a href="index.php">Voltar e fazer outra busca</a></p>
</body>
</html>
Obrigado, boa noite!
Discussão (2)
Carregando comentários...