I want to select the entire column of a mysql database table, but only if a value has not been set.
For mysqli I would have set the value to equal the name of the column without making it a string, however in the PDO query it doesn't work?
I have the following:
$stmt = $this->_db->prepare('SELECT BookDate, DepDate, BkngVal, Channel, Market, Region, MappedType, calc_ExpMargin FROM sales
WHERE MappedType = :tailormade AND Region = :region AND MappedType = :type AND Channel = :channel AND BookDate <= :firstDate AND BookDate >= :secondDate');
$stmt->execute(array(
'tailormade' => $tailormade,
'region' => $region,
'type' => $type,
'channel' => $channel,
'firstDate' => $date1,
'secondDate' => $date2
));
Now lets say that the variables are all set except for $region. If that is the case I want to search all the options with the region option searching the whole region column.
Is this possible?
I hope the question makes sense.