Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/07/2005, 13:21
Avatar de hieloverde
hieloverde
 
Fecha de Ingreso: julio-2005
Ubicación: México, D.F
Mensajes: 467
Antigüedad: 18 años, 9 meses
Puntos: 5
Cita:
Iniciado por aaronmx
Código PHP:
<?php
include("conexio.php");
if(
$enviar) {


$tabla "descargas"// Tabla donde queremos buscar
$campo "descripcion"// Campo donde queremos buscar


$resp mysql_query("select * from $tabla where $campo LIKE '%".$_POST[palabra]."%'") or die (mysql_error());
if(
mysql_num_rows($resp) == "0") {
echo 
"No hay resultados";
} else {
echo 
"Estos son los resultados de la busqueda:<br>";
while(
$sql mysql_fetch_array($resp)) {

echo 
"<table cellSpacing='0' cellPadding='2' width='100%' align='center' border='0'>
  <tr>
    <td width='100%'>
      <table style='BORDER-COLLAPSE: collapse' borderColor='#111111' cellSpacing='0' cellPadding='0' width='100%' border='0' height='54'>
        <tbody>
          <tr>
            <td style='FONT-WEIGHT: bold; FONT-SIZE: 8pt; FONT-FAMILY: arial' width='94%' height='17'><span style='FONT-SIZE: 8pt'>
                <strong style='font-weight: 400'> <a href='http://www.descargasdirectas.net/descargas.php/id/"
.$sql[id]."'>".$sql[nombre]."</a></strong><strong style='font-weight: 400; font-size: 8pt'></strong></span></td>
            <td noWrap width='58' height='17'>
              <p align='center'></p>
            </td>
          </tr>
          <tr>
            <td style='FONT-SIZE: 8pt; COLOR: #435050; FONT-FAMILY: arial' width='94%' height='21'> "
.$sql[descripcion]."</td>
            <td noWrap width='58' height='21'>
              <div align='center'>
                &nbsp;
              </div>
            </td>
          </tr>
          <tr>
            <td style='FONT-SIZE: 8pt; COLOR: #435050; FONT-FAMILY: arial' height='16'><font color='#000000' size='1'>categoria</font><font color='#999999' size='1'>:
              </font><font color='#008000' size='1'> "
.$sql[categoria]."</font><font color='#999999' size='1'>
              </font><font color='#000000' size='1'>Tamaño</font><font color='#999999' size='1'>:</font><font color='#008000' size='1'>"
.$sql[tamaño]." &nbsp;</font></td>
            <td noWrap width='58' height='16'><font size='1'>&nbsp;</font></td>
          </tr>
        </tbody>
      </table>
    </td>
  </tr>
  <tr>
    <td width='100%'><img height='1' src='http://www.descargasdirectas.net/imagenes/linea_menu.gif' width='397' border='0'></td>
  </tr>
</table>"
;


  }
}
}

?>
Te sugiero que cambies esto

$palabra = $_POST['palabra'];
$resp = mysql_query("SELECT * FROM $tabla WHERE `$campo` LIKE '%$palabra%' ");

Creo que ese podria ser el problema, dime si lo solucionaste si no de todas formas voy a revisar a fondo tu codigo para estar seguros, ok.

Saludos