tengo un scrip (buscar.php) y una pagina html que realiza la consulta a travez de un formulario. Le hise unas modificaciones y ahora lo descuageringue porque no me devuelve nada. como si no accediera a la base de datos.
Alguien me puede ver lo que hise porque no le encuentro el error.
Este es el codigo del formulario que envio desde (cunsultareten.htm)
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {color: #006699}
-->
</style>
</head>
<body>
<form action = "buscar.php" method = "POST" name="retenesform" id="retenesform">
<table width="690">
<tr>
<td colspan="2"><div align="center">DBH
<input name="radiobutton" type="radio" value="dbh">
SAV
<input name="radiobutton" type="radio" value="sav">
SABO
<input name="radiobutton" type="radio" value="sabo">
CORTECO
<input name="radiobutton" type="radio" value="corteco">
ANELLI
<input name="radiobutton" type="radio" value="anelli">
</div></td>
</tr>
<tr>
<td width="298"><blockquote>
<p> Búsqueda por Nº
<input name="numerovar" type="text" size="10">
</p>
</blockquote></td>
<td width="376">
<p>Búsqueda por medida de Eje o Alojamiento </p>
<table width="311" cellspacing="2" cellpadding="2">
<tr>
<td width="63" height="44">øInt.
<input name="ejeoaloj" type="radio" value="eje">
Aloj.
<input name="ejeoaloj" type="radio" value="alojamiento"></td>
<td width="24"><input name="varconsulta" type="text" size="4"></td>
<td width="196">Debe especificar un número entero para realizar la consulta. </td>
</tr>
</table>
<blockquote>
<p align="left">
<input name="botonbuscar" type="submit" id="botonbuscar" value="Buscar">
</p>
</blockquote></td>
</tr>
<tr>
<td> </td>
<td><div align="center" class="Estilo1">Los resultados de esta búsqueda son apróximados </div></td>
</tr>
</table>
</form>
</body>
</html>
******************************
y este es el llamado a la consulta en php (buscar.php)
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if (!isset($varconsulta)){
echo "Debe especificar una cadena a bucar";
echo "</html></body> \n";
exit;
}
$link = mysql_connect("localhost", "basedatos", "password");
mysql_select_db("basedatos", $link);
$result = mysql_query(SELECT * FROM `$radiobutton` WHERE `$ejeoaloj` LIKE `$varconsulta%`, $link);
if ($row = mysql_fetch_array($result))
echo "<table border = '1'> \n";
//Mostramos los nombres de las tablas
echo "<tr> \n";
while ($field = mysql_fetch_field($result)){
echo "<td>$field->name</td> \n";
}
echo "</tr> \n";
do {
echo "<tr> \n";
echo "<td>".$row["numero"]."</td> \n";
echo "<td>".$row["eje"]."</td> \n";
echo "<td>".$row["alojamiento"]."</td> \n";
echo "<td>".$row["altura"]."</td> \n";
echo "<td>".$row["diseño"]."</td> \n";
echo "<td>".$row["tipo"]."</td> \n";
echo "<td>".$row["descripcion"]."</td> \n";
echo "</tr> \n";
} while ($row = mysql_fetch_array($result));
echo "</table> \n";
else {
echo "¡ No se ha encontrado ningún registro !";
}
?>
</body>
</html>