Estoy utilizando este buscador:
Código PHP:
$query = 'SELECT * FROM foo';
$conditions = array();
if (foo()) {
$conditions[] = "foo = 'foo'";
}
if (bar()) {
$conditions[] = "bar= 'bar'";
}
if (baz()) {
$conditions[] = "baz= 'baz'";
}
if (count($conditions) > 0)) {
$query .= ' WHERE ' . implode(' AND ', $conditions);
}
Desde ya muchas gracias
Saludos!!