Jump to content
Fórum Script Brasil
  • 0

Select entre datas e combobox opcional



Bom dia,

Gostaria de fazer um select entre datas e um combobox mas que se o campo combobox não fosse preenchido o resultado fosse apenas do intervalo de datas, mas no caso agora está com os 3 campos obrigatorios.


 $procura = mysqli_query($con,"SELECT count(*) AS caminhoes, data as data,obra_cliente,faixa,placa,quantidade,vrunit,vrtotal,horae,horas,ticket 
    FROM dosagem_usina 
    where data between '" .$dtinicio. "' AND '" .$dtfim. "' AND operacao = 'saida' and obra_cliente = '" .$obra. "' group by id order by id desc") 



Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...