Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/03/2006, 13:52
john Doe
 
Fecha de Ingreso: marzo-2006
Mensajes: 16
Antigüedad: 18 años, 1 mes
Puntos: 0
sin acceso a base de datos

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&iacute;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&uacute;squeda por N&ordm;
<input name="numerovar" type="text" size="10">
</p>
</blockquote></td>
<td width="376">
<p>B&uacute;squeda por medida de Eje o Alojamiento </p>
<table width="311" cellspacing="2" cellpadding="2">
<tr>
<td width="63" height="44">&oslash;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&uacute;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>&nbsp;</td>
<td><div align="center" class="Estilo1">Los resultados de esta b&uacute;squeda son apr&oacute;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&iacute;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>