Det virker stadig ikke. Jeg var lidt i tvivl om opsætningen af minprice og maxprice var rigtig (om man kunne bruge/anvende to på én gang).
Min form:
se kildekoden her:
http://www.tackleprices.com/products/fishing-reels/specifications.phpQueryen:
//If the user submitted the specification form, then we make a query to limit the results
if(!empty($specifications_brand)) {
$spec_brand .= "AND b.id='$specifications_brand' ";
}
if(!empty($specifications_minprice)) {
$spec_minprice .= "AND pr.product_price >= '$specifications_minprice' ";
}
if(!empty($specifications_maxprice)) {
$spec_maxprice .= "AND pr.product_price <= '$specifications_maxprice' ";
}
//Make the main query (one table for each active brand)
$query = mysql_query("SELECT
DISTINCT( b.id )
,b.brand
,b.brand_link
,b.id
FROM
brand b
INNER JOIN
series s
ON
b.id = s.brand_id
AND s.type = 'Reels'
AND s.validation_status = '1'
INNER JOIN
products p
ON
s.id = p.series_id
INNER JOIN
prices pr
ON
p.id = pr.product_id
WHERE
b.status='1'
AND b.validation_status='1'
$spec_brand
$spec_minprice
$spec_maxprice
ORDER BY
b.brand") or die (mysql_error());
while($fetch = mysql_fetch_array($query)) {