Link to home
Start Free TrialLog in
Avatar of dstratford
dstratford

asked on

PHP query posts array

I have a search form which brings in 3 variables. The 3 variables correspond to custom fields in each post of a specific category. How can i get this query to show results matching ALL variables, instead of either of the three?

<?php

$type = $_POST["type"];
$price = $_POST["price"];
$location = $_POST["location"];

$args = array(
   'cat'                 => 16,
   'meta_value'   => $type,
   'meta_value'   => $price,
   'meta_value'   => $location,
   );

query_posts($args);

?>
ASKER CERTIFIED SOLUTION
Avatar of wuff1uk
wuff1uk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Richard Davis
Richard Davis
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dstratford
dstratford

ASKER

thank you very much for your comments - i'm getting really close! f i don't figure it out from here i may repost question with better details