Search
| From: | Emiliano Boragina | Date: | Fri, 16 Oct 2009 00:58:15 +0000 |
| Subject: | Search | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-46579@lists.php.net to get a copy of this message | ||
Hello
Im 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@gmail.com /
// 15 40 58 60 02 ///////////////////////////
+
_