Applying Multiple Filters
-
I am using an HTML form to filter out certain Airtable data on the website side of things. The issue I am having using the
$query->addFilter()
function is that I can’t use multiple filters at once. Am I just using it wrong, or does it only allow one filter to be applied? Here’s my code:`<?php
$query = new AirpressQuery();$query->setConfig(/*Insert title of Airtable Connection configuration*/”Speeds & Feeds”);
$query->table(“Cutting Tool”)->view(“Grid view”);
if($_POST[‘Brand_Lakeshore_Carbide’] == “Lakeshore Carbide”){
$query->addFilter(“{Brand}=’Lakeshore Carbide'”);
}
elseif($_POST[‘Brand_AB_Tools’] == “AB Tools”){
$query->addFilter(“{Brand}=’A.B. Tools'”);
}
elseif($_POST[‘Type_Face_Mill’] == “Face Mill”){
$query->addFilter(“{Type of Cutting Tool}=’Face Mill'”);
}$events = new AirpressCollection($query);
foreach($events as $e){
$piclink = $e[“Tool Picture Link”];
echo $e[“Tool Diameter”] . “<br>”;
}
?>
- The topic ‘Applying Multiple Filters’ is closed to new replies.