close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Price range search

Thread began 10/23/2009 9:37 am by maurizio.melandri390100 | Last modified 10/28/2009 11:48 am by maurizio.melandri390100 | 3826 views | 7 replies

maurizio.melandri390100

Originally Said By: Eric Mittman
  In your code it looks like you are using the same input for the value of both search criteria:

$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 :(

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...