0
I have 3 selects in my code where:
- If the user enters the start date and the end date will show the data between them.
- If the user enters the invoice will show the data with this note.
- If the user selects the peripheral will show all the data with this registered name.
Now my question is: How to make the select stay:
- If select initial date /final and peripheral date, be shown the peripherals (with the name given) registered within the dates defined?
- If select invoice and ancillary note just show the selected peripheral of that note!
Selects code:
if($w_op == "P"){ //P é o periférico
$w_query="where sai_tb_peri.seq_peri = '$w_cb_peri'";
}
else
if($w_op == "N"){ //N é a nota fiscal
$w_query="where sai_cad_nf.num_nf = '$w_tx_nota'";
}
else{ //Caso for nenhum é as datas
$w_query="where sai_cad_nf.dt_nota_fisc between '$w_tx_dt_inic' and '$w_tx_dt_fina'";
}
$w_querybusca="SELECT * FROM sai_cad_cara_peri
INNER JOIN sai_tb_peri on sai_cad_cara_peri.fk_seq_peri = sai_tb_peri.seq_peri
INNER JOIN sai_cad_nf ON sai_cad_cara_peri.fk_seq_nf = sai_cad_nf.seq_nf $w_query;";
Yeah. Thanks @Marcelodiniz but it didn’t work out!
– Felipe
Okay, but what didn’t work out?
– Marcelo Diniz
The select itself does not recognize the clause
$w_query
! I will make some changes and I have already reedited here!– Felipe
I made a small change, see if that was it, or if you can give more details of the errors! When you try to print $w_querybusca what does?
– Marcelo Diniz