Good people,
I need a help, I'm doing a filter and to do the select I did so:
$molcomp_query="SELECT * FROM stock_comp WHERE (diametroaco BETWEEN '$d1' and '$d2')
AND (comprimentototal BETWEEN '$comp1' AND '$comp2')
AND (diametroexterior BETWEEN '$de1' AND '$de2') $ordenar_por";
but you are giving error in this area:
if(isset($_POST)&&!empty($_POST)){
if ($d1<>""){
$d1=$_POST["d1"];
}else{
$d1=="0,200";
}
if ($d2<>""){
$d1=$_POST["d2"];
}else{
$d2=="20";
}
if ($comp1<>""){
$d1=$_POST["comp1"];
}else{
$comp1=="1";
}
if ($comp2<>""){
$d1=$_POST["comp2"];
}else{
$comp2=="10000";
}
if ($de1<>""){
$d1=$_POST["de1"];
}else{
$de1=="1";
}
if ($de2<>""){
$d1=$_POST["de2"];
}else{
$de2=="200";
}
}
I did this to check if the form's text box is not empty so the variable would have the value that the user entered, but if it is empty the variable would have a value assigned by me, which is the minimum, and the maximum value of each field with some margin.