![]() |
![]() |
![]() |
![]() |
![]() |
FTP | ![]() |
![]() |
CCD | ![]() |
![]() |
Buscar | ![]() |
![]() |
Trucos | ![]() |
![]() |
Trabajo | ![]() |
![]() |
Foros | ![]() |
#1
|
|||
|
|||
![]() hola a todos
estoy realizando un bucador de base de datos en php no se donde esta la falla, pero no quiere llevar el nombre del formulario.htm al buscador_1.php. donde esta el error o que puedo hacer: ![]() mi formulario de entrada es la siguiente (formulario.htm) <html> <body> <form method="POST" action="buscador_1.php"> <strong>Palabra clave:</strong> <input type="text" name="T1" size="20"><br><br> <input type="submit" value="Buscar" name="buscar"> </form> </body> </html> y mi script es: (buscador_1.php) <html> <body> <?php if (!isset($buscar)){ echo "debe colocar el texto a buscar"; echo "</html> </body> \n"; exit; } $l=mysql_connect("localhost","root"); mysql_select_db("mydb",$l); $r=mysql_query("select *from agenda where nombre like '%$buscar%' order by nombre",$l); if ($row=mysql_fetch_array($r)){ echo "<table border ='1' > \n"; echo "<tr> \n"; while ($field=mysql_fetch_field($r)){ echo "<td> $field->name </td> \n"; } echo "</tr> \n"; do { echo "<tr> \n"; echo "<td>".$row["id"]."</td> \n"; echo "<td>".$row["nombre"]."</td> \n"; echo "<td>".$row["Direccion"]."</td> \n"; echo "<td>".$row["telefono"]."</td> \n"; echo "<td>".$row["email"]."</td> \n"; echo "</tr>"; } while ($row=mysql_fetch_array($r)); echo "</table> \n"; } else { echo "No se encontro ningun registro"; } ?> </body> </html> |
|
|
![]() |
|