Gebruik null-safe equality:
$sql = 'select 1 from table where id = ? and self <=> ? and parent <=> ?'; $stm = $conn->prepare($sql); $stm->execute([$id, $self, $parent]);De operator <=> behandelt NULL als vergelijkbare waarde.
Gebruik null-safe equality:
$sql = 'select 1 from table where id = ? and self <=> ? and parent <=> ?'; $stm = $conn->prepare($sql); $stm->execute([$id, $self, $parent]);De operator <=> behandelt NULL als vergelijkbare waarde.