0 AND vis>0 ORDER BY sub ASC, ord ASC, nom_cat ASC"; $r = mysql_query($q) or die('Query failed: '.mysql_error()); if($query['buscar']){ $bus = $query['buscar']; $palabras = explode(" ", preg_replace("/\s+/", " ",$query['buscar'])); foreach($palabras as $palabra){ $wherelike[] = "(title LIKE '%$palabra%' OR det LIKE '%$palabra%') "; } $where = implode(" AND ", $wherelike); $q2 = "SELECT * FROM $IS_CONFIG[db_table1] WHERE $where AND vis=1 ORDER BY title ASC"; } elseif($query['marca'] == "" && $query['escala'] == "" && $query['vehiculo'] == ""){ $q2 = "SELECT * FROM $IS_CONFIG[db_table1] WHERE home=1 AND vis=1 ORDER BY title ASC"; }else{ $join = ''; $where = ''; if($query['marca']){ $join .= ' RIGHT JOIN categorias AS marcas ON marcas.nom_cat LIKE "'.$query['marca'].'"'; $where .= ' AND productos.marca = marcas.id_cat'; } if($query['escala']){ $join .= ' RIGHT JOIN categorias AS escalas ON escalas.nom_cat LIKE "'.$query['escala'].'"'; $where .= ' AND productos.escala = escalas.id_cat'; } if($query['vehiculo']){ $join .= ' RIGHT JOIN categorias AS vehiculos ON vehiculos.nom_cat LIKE "'.$query['vehiculo'].'"'; $where .= ' AND productos.vehiculo = vehiculos.id_cat'; } $q2 = 'SELECT productos.* FROM productos '.$join.' WHERE productos.vis>0 '.$where.' ORDER BY productos.title ASC'; } $r2 = mysql_query($q2) or die('Query failed: ' . mysql_error()); ?> <?php if($bus){echo str_replace('-',' ',ucfirst($bus)).' - ';}?>CLÁSICOS EN ESCALA - Autos de colección en miniatura VISITA NUESTRO E-SHOP EN MERCADOLIBRE
Resultados buscando: '.strtoupper($bus).'x';}?>
';}else{$cod='';} if($p[price]>0){$pre = '
$'.$p[price].'
';}else{$pre='';} if($p[img1]){ echo '
  • '; echo ''.$cod.''.utf8_encode($p[title]).''; if($p[img2]){echo '';} if($p[img3]){echo '';} if($p[img4]){echo '';} }else{ echo '
  • '.$cod.''.utf8_encode($p[title]).''; } echo '

    '.utf8_encode($p[title]).'

    '.nl2br(utf8_encode($p[det])).'

    '.$pre.'
    HAY STOCK';}else{echo' r">SIN STOCK';} echo '
    '; echo ''; echo '
  • '; } ?>
    © CLÁSICOS EN ESCALA - Autos de colección en miniatura.