Hi,
is it possible to run a SELECT query where the parameter is NULL?
I am trying the following but it does not work for me:
I also tried the following without any luck:
is it possible to run a SELECT query where the parameter is NULL?
I am trying the following but it does not work for me:
$connection=Yii::app()->db; $sql = "SELECT id, categoryName FROM categories WHERE parentId=:parentId"; $command=$connection->createCommand($sql); $parentId = NULL; $command->bindParam(":parentId",$parentId,PDO::PARAM_INT); print_r($command->queryAll());
I also tried the following without any luck:
$command->bindParam(":parentId",$parentId,PDO::PARAM_NULL);