Search

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello
I?m using this code to a search:

$sql = "SELECT empresas.id, empresas.nombre, rubros.id, rubros.nombre,
cupones.empresa, cupones.rubro, cupones.titulo, cupones.descripcion FROM
cupones INNER JOIN empresas INNER JOIN rubros ON (empresas.id =
cupones.empresa OR rubros.id = cupones.rubro) WHERE (empresas.nombre LIKE
'%$_GET[busqueda]%' OR rubros.nombre LIKE '%$_GET[busqueda]%' OR
cupones.titulo LIKE '%$_GET[busqueda]%' OR cupones.descripcion LIKE
'%$_GET[busqueda]%')";

I have a input text with name ?clave?.
I have three tables: empresas, rubros anda cupones.
The ?empresa? table has got ID and NOMBRE The ?rubro? table has got ID and
NOMBRE And the ?cupones? table has got ID (from the coupon), EMPRESA (int),
RUBRO (int) , TITULO, DESCRIPCION

The client has got 100 coupons (CUPONES table) in the data base.
He wants to search in any of these fields, but with tath code the search
return 200 or 1000 results.

If the total of coupons are 100, what should I do to the searching return
only one time the coupon with the keyword insert to search...
Thanks a lot


+                                                                          _
   // Emiliano Boragina _
   // Diseño & Comunicación //////////////////
+                                                                          _
   // emiliano.boragina@xxxxxxxxx  /
   // 15 40 58 60 02 ///////////////////////////
+                                                                          _



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux