<form method="POST" class="w-100" action="pesquisa_diaria.php">
<div class="card-body">
<div class="row">
<div class="col-sm-3">
<label>Tipo de Venda</label>
<select class="custom-select" name="tipo_vendas" required>
<option value=''>Selecione...</option>
<option value='caixa'>Caixa</option>
<option value='delivery'>Delivery</option>
<option value='null'>Todos</option>
</select>
</div>
<div class="col-sm-3">
<label>Tipo de Pagamento</label>
<select class="custom-select" name="tipo_pagamento" required>
<option value=''>Selecione...</option>
<option value='cartao_credito'>Cartão de Credito</option>
<option value='cartao_debito'>Cartão de Debito</option>
<option value='dinheiro'>Dinheiro</option>
<option value='null'>Todos</option>
</select>
</div>
<div class="col-sm-3">
<label>Data</label>
<input id="datepicker" name="data" width="276" required/>
</div>
<div class="col-12 text-right align-self-end">
</br><button type="submit" class="btn btn-success">Pesquisar</button>
</div>
</div>
</div>
</form>
I have a form that does a query in the database, but I have a problem in the "All" options. When I select this option, the query does not yield any results.
SELECT * FROM vendas WHERE DATE(date_created) = '2018-12-12'
AND tipo_venda = 'null' AND tipo = 'null' ORDER BY 'id'