How can I bind NULL
in the following scenario. No matter what I do, I can't get it to work.
if ($type == 1) {
$self = 'NULL';
$parent = 'NULL';
}
$findThis = $conn->prepare('select count(id) as exists from table where id = :id and self = :self and parent = :parent';
$findThis->execute(array(
":id" => $id,
":self" => $self,
":parent" => $parent
));