Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Info:
Galera, estou quebrando a cabeca pra descobrir o problema nesse codigo.
Ele acha, mas nao aparece os resultados, fica em branco.
Quando acha resultados:
/applications/core/interface/imageproxy/imageproxy.php?img=http://img809.imageshack.us/img809/31/ss1oa.png&key=449732be292b982a169790aeede160ed8b15d4965de2b8ffd0497980fde4e7c3" alt="ss1oa.png" />
Quando NÃO acha:
/applications/core/interface/imageproxy/imageproxy.php?img=http://img94.imageshack.us/img94/5772/41284971.png&key=86e9adc35cdc0aea13f7ae888523a24546845e2a1afa46d7aec13fdff48e0b87" alt="41284971.png" />
-> Codigo index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Eliz Consultoria</title>
</head>
<body>
<h2>Sistema de Busca</h2>
<p>Database Teste - <strong>Eliz Imóveis</strong></p>
<form id="form1" name="form1" method="post" action="busca.php">
<label>
<input type="text" name="campo_busca" id="campo_busca" />
</label>
<label>
<input type="submit" name="button" id="button" value="Efetuar Busca" />
</label>
</form>
</body>
</html>
BUSCA.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Busca - Eliz</title>
</head>
<body>
<p>
<?php
$conecta = mysql_connect("localhost","root","hihihi");
mysql_select_db("elizdb");
$criterio = $_POST['campo_busca'];
$query = mysql_query("SELECT * FROM tabelas WHERE tabelas.nome LIKE '%$criterio%'");
$nr_linhas = mysql_num_rows($query);
?>
</p>
<table width="522" border="1">
<tr>
<td width="62" align="center">Número</td>
<td width="321" align="center">Endereço do imóvel</td>
<td width="117" align="center">Preço</td>
</tr>
<?php for($i=0;$i<$nr_linhas;$i++){ $campo = mysql_fetch_assoc($query); ?>
<tr>
<td><? echo $campo['id']; ?></td>
<td><? echo $campo['nome']; ?></td>
<td>R$ <? echo number_format($campo['preco'],2,",","."); ?></td>
</tr>
<?php } ?>
</table>
<p><a href="index.php">Voltar e fazer outra busca</a></p>
</body>
</html>
Me ajudem ! haha, obrigado e tenham um bom dia !
abraço :cheekkiss:
Carregando comentários...