PHP - keywords split search php

 
Vista:
sin imagen de perfil

keywords split search php

Publicado por Juan Carlos (7 intervenciones) el 19/05/2016 21:48:56
Hola, como están??
Necesito un poco de ayuda :)


Tengo el siguiente código el cual a travez de un input hace una búsqueda en una BD lo que hace perfecto,
lo que necesito hacer ahora por solicitud es que en el mismo input se pueda ingresar más de una dato.

por ejemplo : Daniel Alejandro Pablo

y la columna en la BD

NOMBRES
Daniel
Alejandro
Pablo




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<form name="form1" method="post" action="inicio.php" id="odr" >
		<input  name="busca" minlength="5"  type="search" id="busqueda" placeholder="Ingrese una búsqueda">
		<label for="search" style=" margin-left: -17px; margin-top: 2px;"><i class="material-icons" style="margin-   right:-22px; cursor: pointer">close</i></label>
		<i class="material-icons"><button type="submit" name="submit" style="border: solid 1px #fff; background-color:  #fff; height:70px">search</button></i></label>
 
	</div>
</form>
 
 
<?php
    $busca="";
    $busca=$_POST ['busca'];
    if ($busca!=""){
    $busqueda = mysql_query ("SELECT * FROM info WHERE image LIKE '%".$busca."%'");
    $número_filas = mysql_num_rows($busqueda);
 
    }
    ?>
    <div class="col s12" style=" font-size: 18px; font-weight: bold; text-align: center">
    <?
    echo "$número_filas Vistas\n";
     ?>
     </div>
 
  </div>
</div>
<h4 style="text-align:center">RESULTADOS</h4>
 
 
<!--INICIO TABLA-->
 
 
 
<table class="highlight" >
	<tr style="font-weight: bold; background-color: #f0f0f0;">
		<td style="width:20%;">ID</td>
		<td>Imagen</td>
		<td>Resolución</td>
		<td>Última modificación</td>
		<td>Dimenciones</td>
 
 
	</tr>
 
<!-- populate table from mysql database -->
 
 
 
 
	<?
	while ($muestra = mysql_fetch_array ($busqueda)){
 
	echo '<tr>';
	echo '<td style="width:20%">' .$muestra['image'].'</td>';
	echo '<td class="modal-trigger" href="#modal1"> <img style="width:80px; height:80px; cursor: pointer" onclick="cargarImagenModal(this.src)" src="http://s7d5.scene7.com/is/image/SodimacCL/'.$muestra['image'].'?wid=400&hei=400"/> </td>';
	echo '<td>' .$muestra['resolution'].'</td>';
	echo '<td>' .$muestra['lastModified'].'</td>';
	echo '<td>' .$muestra['size'].'</td>';
 
	}
	?>
</table>


Agradecería la ayuda.

Saludos
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder