Say I have this query:\[code\]$qry = 'SELECT p.id FROM products p WHERE p.type = :type AND p.parent = arent';\[/code\]If I wanted to make "type" optional then the only way I know how to do it would be to do something like this:\[code\]$qry = 'SELECT p.id FROM products p WHERE p.parent = arent';if(isset($type)){ $qry .= 'AND p.type = :type';}\[/code\]Is this the best way? I am wondering if there is a way I can keep it like the original, and use some sort of parameter to indicate that it is optional... For example if $type = "*" then pull all types.Whats the best way to do this?