Estou fazendo um trabalho de conlusão de curso que é um cadastro via web, a pagina de cadastro já esta pronta mas minha busca não retorna os dados corretos de forma alguma gostaria que alguém me desse uma ajuda. - codigo do do busca.htm <!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>Documento sem título</title>
</head>
<body>
<form action="busca_resultado.php" method="get" name="form1" id="form1">
<table width="700" border="1">
<tr>
<td width="91">Buscar:</td>
<td width="361"><label>
<input type="text" name="busca" id="busca" />
</label></td>
<td width="226"><label>
<input name="Submit" type="submit" id="Submit" value="Buscar no site" />
</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</form>
</body>
</html>
- codigo do busca_resultado.php
<?php require_once('Connections/ConnCatalogo.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$busca_rsBusca_Resultado = "-1";
if (isset($_GET['busca'])) {
$busca_rsBusca_Resultado = $_GET['busca'];
}
mysql_select_db($database_ConnCatalogo, $ConnCatalogo);
$query_rsBusca_Resultado = sprintf("SELECT codigo, objeto, id, lancador FROM objeto WHERE objeto.objeto LIKE %s OR objeto.id LIKE %s", GetSQLValueString("%" . $busca_rsBusca_Resultado . "%", "int"),GetSQLValueString("%" . $busca_rsBusca_Resultado . "%", "int"));
$rsBusca_Resultado = mysql_query($query_rsBusca_Resultado, $ConnCatalogo) or die(mysql_error());
$row_rsBusca_Resultado = mysql_fetch_assoc($rsBusca_Resultado);
$totalRows_rsBusca_Resultado = mysql_num_rows($rsBusca_Resultado);
$busca_rsBusca_Resultado = "-1";
if (isset($_GET['busca'])) {
$busca_rsBusca_Resultado = $_GET['busca'];
}
?>
<!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>Documento sem título</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<p> </p>
<p>Lista Busca</p>
<table width="919" border="1">
<tr>
<td width="91">Codigo</td>
<td width="153">Objeto</td>
<td width="58">Id</td>
<td width="91">Lançador</td>
</tr>
<?php do { ?>
<tr>
<td><p><?php echo $row_rsBusca_Resultado['codigo']; ?></p>
<p> </p></td>
<td><?php echo $row_rsBusca_Resultado['objeto']; ?></td>
<td><?php echo $row_rsBusca_Resultado['id']; ?></td>
<td><?php echo $row_rsBusca_Resultado['lancador']; ?></td>
</tr>
<?php } while ($row_rsBusca_Resultado = mysql_fetch_assoc($rsBusca_Resultado)); ?>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</form>
</body>
</html>
<?php
mysql_free_result($rsBusca_Resultado);
?> Não consigo de forma alguma retornar os dados do formulario, estou usando como banco de dados o mysql e o dreamweaver CS4