$WADbSearch1->addComparisonFromEdit("dhpc_Prezzo","S_dhpc_Prezzo","AND","<=",1);
$WADbSearch1->addComparisonFromEdit("dhpc_Prezzo","S_dhpc_Prezzo","AND",">=",1);
This will not give you any results because you are saying, 'give me the values from this column where S_dhpc_Prezzo is less then or equal to the value in the db, AND where S_dhpc_Prezzo is greater than or equal to the value'. This does not make sense and will not yield any results for you. Instead you must have two separate form elements, one for the minimum value and another for the max value. Use the max value one with the <= criteria, and the minimum value one for the >= criteria.
I had not seen. I know a little PHP. I have corrected, but there is no improvement, unfortunately...
This is my forms (building with DataAssist)
<form action="lista-prodotti-cercati.php" method="get" name="WADASearchForm" id="WADASearchForm">
<div class="WADAHeader">Search</div>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">DHPC_Descrizione_tipo:</th>
<td class="WADADataTableCell">
<select name="S_DHPC_Descrizione_tipo" id="S_DHPC_Descrizione_tipo">
<?php
do {
?>
<option value="<?php echo $row_WADADynListdhpc_prodotti['DHPC_Descrizione_tipo']?>"><?php echo $row_WADADynListdhpc_prodotti['DHPC_Descrizione_tipo']?></option>
<?php
} while ($row_WADADynListdhpc_prodotti = mysql_fetch_assoc($WADADynListdhpc_prodotti));
$rows = mysql_num_rows($WADADynListdhpc_prodotti);
if($rows > 0) {
mysql_data_seek($WADADynListdhpc_prodotti, 0);
$row_WADADynListdhpc_prodotti = mysql_fetch_assoc($WADADynListdhpc_prodotti);
}
?>
</select>
</td>
</tr>
<tr>
<th class="WADADataTableHeader">dhpc_Sigla:</th>
<td class="WADADataTableCell"><input type="text" name="S_dhpc_Sigla" id="S_dhpc_Sigla" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">dhpc_Prezzo:</th>
<td class="WADADataTableCell"><input type="text" name="S_dhpc_Prezzo" id="S_dhpc_Prezzo" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">dhpc_Prezzo:</th>
<td class="WADADataTableCell"><input type="text" name="S_dhpc_Prezzo2" id="S_dhpc_Prezzo2" value="" size="32" /></td>
</tr>
</table>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Search" id="Search" value="Search" alt="Search" src="WA_DataAssist/images/Pacifica/Refined_search.gif" /></td>
</tr>
</table>
</div>
</form>
This is the correct statement.
//comparison list additions
$WADbSearch1->addComparisonFromList("DHPC_Descrizione_tipo","S_DHPC_Descrizione_tipo","AND","=",0);
$WADbSearch1->addComparisonFromEdit("dhpc_Sigla","S_dhpc_Sigla","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("dhpc_Prezzo","S_dhpc_Prezzo","AND","<=",1);
$WADbSearch1->addComparisonFromEdit("dhpc_Prezzo","S_dhpc_Prezzo2","AND",">=",1);
The results is: No results for your search, but i have records for the condition :(