Ummm...AJAX doesn't do any filtering unless you write it. For that matter, neither does jQuery.
More than likely, you *SHOULD* do the filtering in PHP/MySQL.
Why not something simple:
Code:
$a = isset($_POST["a") ) ? $_POST["a"] : '%';
$b = isset($_POST["b") ) ? $_POST["b"] : '%';
??
Usually, people send AJAX requests as part of the query string, though, so then you would use:
Code:
$a = isset($_GET["a") ) ? $_GET["a"] : '%';
$b = isset($_GET["b") ) ? $_GET["b"] : '%';
You see it? If there's no
a=value in the querystring (or in the post data, as the case may be), then $a defaults to %. If there is a value, $a receives it, same with $b.
It's probably a TINY bit more efficient to code those as
Code:
$a = $_GET["a"]; if ( ! isset($a) ) { $a = "%"; }
$b = $_GET["b"]; if ( ! isset($b) ) { $b = "%"; }
(or use POST instead of GET, of course).