Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/01/2013, 13:19
KAKOROSAS
 
Fecha de Ingreso: enero-2004
Mensajes: 72
Antigüedad: 21 años, 2 meses
Puntos: 1
mostrar todos los registros que contengan una palabra a buscar

hola amigo .. tengo el siguiente php y me funcione excelente

Código PHP:
<?php 
if(isset($_POST['buscar']))
{
    if(
$_POST['numero'] == '')
    {
        echo 
'Por favor ingrese un numero de factura valido.';
    }
    else
    {
        
            if(
$_POST['numero'] == $_POST['numero'])
            {
                
$numero $_POST['numero'];
                               
$sql =  
                                
mysql_query("set names utf8");
$result mysql_query("SELECT numero, fecha, glosa, abstracto, enlace FROM factura WHERE numero = '$numero'");
                if (
$row mysql_fetch_array($result)){ 
      echo 
"<table class='hovertable' table style = 'tabla' table border = '0,5'> \n";  
echo 
"<tr><th width='65'>N Factura</th><th width='70'>Fecha</th><th width='389'>Detalle</th><th width='70'>Abstract</th></tr> \n";
   do { 
      echo 
"<tr><td>".$row["numero"]."</td><td>".$row["fecha"]."</td><td align='justify'>".$row["glosa"]."</td><td align='center'><a href='".$row["abstracto"]."'><img src='pdf.png'></a></td></tr> \n";  
   } while (
$row mysql_fetch_array($result)); 
   echo 
"</table> \n"
} else { 
echo 
"¡ No se ha encontrado ningún registro !"
} }}}
?>
    </p><
en este busco por el numero de factura

ahora necesito implementar el buscador por palabra... es decir

si alguien coloca 1 2 3 .. o N palabras, que muestre la los registros que en la glosa tienen esa palabra, obviamente voy a limitar la cantidad de palabras posteriormente.. pero asumamos que pueden ser de 1 a 3 palabras aprox

gracias por su tiempo