Advanced search for a price range while searching for an empty values using php in DW

I'm creating an advanced search with DW php. I want to present a research where some titles can be left black. If looking for empty values (which I did, thank you David Powel), however then research across a range of prices doesn't seem to work.

Please see attached form:

The search page:

<form action="Detailed-Search-Result.php" method="get" target="_self"><table width="90%" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td colspan="2"><label for="Detailed Search">Advanced Search</label></td>
    </tr><tr>
    <td><label for="Product">Product:</label>
      </td>
    <td><select name="Category" id="Category">
      <option value=></option>
        <option value="Keyboard">Keyboard</option>
        <option value="Piano">Piano</option>
      </select></td>
  </tr>
  <tr>
    <td><label for="Make">Make:</label>
    </td>
    <td><select name="Manufacturer">
      <option value=></option>
      <option value="Boss">Boss</option>
      <option value="Casio">Casio</option>
      <option value="Kawai">Kawai</option>
      <option value="Ketron">Ketron</option>
      <option value="Korg">Korg</option>
      <option value="Roland">Roland</option>
      <option value="Samson">Samson</option>
      <option value="Yamaha">Yamaha</option>
    </select></td>
  </tr>
  <tr>
    <td><label for="Color">Color:</label></td>
    <td><select name="Color">
      <option value=></option>
      <option value="Black">Black</option>
      <option value="Cherry">Cherry</option>
      <option value="Mahogany">Mahogany</option>
      <option value="Polished Eboney">Polished Eboney</option>
      <option value="Rosewood">Rosewood</option>
      <option value="White">White</option>
      <option value="Red">Red</option>
    </select></td>
  </tr>

  <tr>
    <td><label for="Price">Price:</label></td>
    <td><select name="Price">
      <option value=></option>
      <option value="0-500">£0-500</option>
      <option value="500-1000">£500-1000</option>
      <option value="1000-2000">£1000-2000</option>
      <option value="2000">£2000&gt;</option>
    </select></td>
  </tr>
  <tr>
    <td colspan="2">
      <input name="Search2" type="submit" id="Search2"></td>
    </tr>
    </table>
</form>

The results page

$varCategory_rsgetsearch2 = "%";
if (isset($_GET['Category'])) {
  $varCategory_rsgetsearch2 = $_GET['Category'];
}
$varMake_rsgetsearch2 = "%";
if (isset($_GET['Manufacturer'])) {
  $varMake_rsgetsearch2 = $_GET['Manufacturer'];
}
$varColor_rsgetsearch2 = "%";
if (isset($_GET['Color'])) {
  $varColor_rsgetsearch2 = $_GET['Color'];
}
$varPrice_rsgetsearch2 = "%";
if (isset($_GET['Price'])) {
  $varPrice_rsgetsearch2 = $_GET['Price'];
}
mysql_select_db($database_dBconn, $dBconn);
$query_rsgetsearch2 = 'SELECT * FROM products';
$where = false;
if (isset($_GET['Category']) && !empty($_GET['Category'])) {
 $query_rsgetsearch2 .= ' WHERE Category LIKE varCategory '. GetSQLValueString($_GET['Category'], 'text');
  $where = true;
}
if (isset($_GET['Manufacturer']) && !empty($_GET['Manufacturer'])) {
  if ($where) {
   $query_rsgetsearch2 .= ' AND ';
  } else {
   $query_rsgetsearch2 .= ' WHERE ';
    $where = true;
  }
 $query_rsgetsearch2 .= 'Manufacturer LIKE varManufacturer ' . GetSQLValueString($_GET['Manufacturer'], 'text');
}
if (isset($_GET['Color']) && !empty($_GET['Color'])) {
    if ($where) {
   $query_rsgetsearch2 .= ' AND ';
  } else {
   $query_rsgetsearch2 .= ' WHERE ';
    $where = true;
  }
  $query_rsgetsearch2 .= 'Color LIKE varColor ' . GetSQLValueString($_GET['Color'], 'text');
}
if (isset($_GET['Price']) && !empty($_GET['Price'])) {
    if ($where) {
                    } 
   $query_rsgetsearch2 .= ' AND ';
  } else {
   $query_rsgetsearch2 .= ' WHERE ';
    $where = true;
  }
 switch( $_GET['Price'] ){
        case '0-500':
        $query_rsgetsearch2 .= '  RRP BETWEEN 0 AND 500 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
        break;
          case '500-1000':
        $query_rsgetsearch2 .= ' RRP BETWEEN 500 AND 1000 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
        break;
                    case '1000-2000':
        $query_rsgetsearch2 .= ' RRP BETWEEN 1000 AND 2000 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
        break; 
          case '2000':
       $query_rsgetsearch2 .= ' RRP BETWEEN 2000 AND 10000 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
        break;
}

$query_rsgetsearch2 = sprintf("SELECT * FROM products WHERE Category LIKE %s AND products.Manufacturer LIKE %s AND products.Color LIKE %s", GetSQLValueString("%" . $varCategory_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varMake_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varColor_rsgetsearch2 . "%", "text"));
$query_limit_rsgetsearch2 = sprintf("%s LIMIT %d, %d", $query_rsgetsearch2, $startRow_rsgetsearch2, $maxRows_rsgetsearch2);
$rsgetsearch2 = mysql_query($query_limit_rsgetsearch2, $dBconn) or die(mysql_error());
$row_rsgetsearch2 = mysql_fetch_assoc($rsgetsearch2);

I would be greatfull for any help

I managed to solve the problem.

Ultimately I don't check if the values were empty, as it worked fine without. However, the switch of the price did not work in combination with the rest of the query.

I solved the problem as follows:

$varCategory_rsgetsearch2 = "%";
if (isset($_GET['Category'])) {
  $varCategory_rsgetsearch2 = $_GET['Category'];
}
$varMake_rsgetsearch2 = "%";
if (isset($_GET['Manufacturer'])) {
  $varMake_rsgetsearch2 = $_GET['Manufacturer'];
}
$varColor_rsgetsearch2 = "%";
if (isset($_GET['Color'])) {
  $varColor_rsgetsearch2 = $_GET['Color'];
}
$varPrice_rsgetsearch2 = "%";
if (isset($_GET['Keysound_price'])) {
  $varPrice_rsgetsearch2 = $_GET['price'];

}
mysql_select_db($database_dBconn, $dBconn);
$query_rsgetsearch2 = sprintf("SELECT * FROM products WHERE Category LIKE %s AND products.Manufacturer LIKE %s AND products.Color LIKE %s", GetSQLValueString("%" . $varCategory_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varMake_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varColor_rsgetsearch2 . "%", "text") );
switch( $_GET['price'] ){
        case '0-500':
        $query_rsgetsearch2 .= ' AND price BETWEEN 0 AND 500 ORDER BY price ASC';
        break;
          case '500-1000':
        $query_rsgetsearch2 .= ' AND price BETWEEN 500 AND 1000 ORDER BYprice ASC';
        break;
                    case '1000-2000':
        $query_rsgetsearch2 .= ' AND price BETWEEN 1000 AND 2000 ORDER BY price ASC';
        break;
          case '2000':
        $query_rsgetsearch2 .= ' AND price BETWEEN 2000 AND 10000 ORDER BY price ASC';
        break;
}

$query_limit_rsgetsearch2 = sprintf("%s LIMIT %d, %d", $query_rsgetsearch2, $startRow_rsgetsearch2, $maxRows_rsgetsearch2);
$rsgetsearch2 = mysql_query($query_limit_rsgetsearch2, $dBconn) or die(mysql_error());
$row_rsgetsearch2 = mysql_fetch_assoc($rsgetsearch2);

I'm sure you can keep checking the values, however for me the most was not necessary for this.

Thanks for your help

Tags: Dreamweaver

Similar Questions

  • Data for an empty value in a report formatting

    Hello world


    I've created a report of a region with four measure. In this report, I have no data for some areas. But still I want to display "Zero" instead of the empty value.


    Please any one help me for that matter.

    Scenario is:

    A B C D

    US 12 23 0
    UK 34 56 in white
    White Asian 67 67



    Concerning
    REDA

    Jin
    With the HELP of Filter (IFNULL(MEASURE_NAME,0) cal_month between ' 2009 - 04 - 01 00:00:00.000' and ' 00:00:00.000' 2009-12-01)

    If you found this useful award of points

    Thank you
    Angelique

  • How to make an advanced search when you use adobe reader software in a firefox window?

    I used to be able to do an advanced search in a tab in firefox, but when I updated firefox to version 17.x 33.0 version, the interface has changed and I cannot figure out how to do more.

    Finally, I realized that a simple search can be made with Ctrl-F, but I would get the Advanced Search Panel.
    When I use internet explorer, it has a binoculars icon that will open the advanced search. Firefox doesn't have this.

    In addition, Firefox put up their own PDF Viewer with version 19.0; It's no longer using the Adobe Reader plugin.  See http://helpx.adobe.com/acrobat/kb/pdf-browser-plugin-configuration.html

  • Where is the 'advanced search' function to search for modules?

    Previously, when "shopping" for a new add-on, I clicked on 'Advanced search', which helped specify me that these limits as extensions only (not), my OS, version of Firefox recently updated rating minimum, etc.. I see that more - surely it's not really gone while the number of available modules continues to grow.

    I've been to the 'store' through the Add-ons Manager, Access tab modules get. Is there a better way to avoid having to sort through dozens of the less appropriate offers?

    TiA,
    K

    You can use this link and then use the header to sort the results. I chose 'Rating' on this particular occasion: https://addons.mozilla.org/en-US/firefox/extensions/?sort=rating

  • Changing numeric value in the advanced search datafinder range

    I try to use the Datafinder advanced search to get all files with a certain value in the amplitude channel.  I'm trying to do it by searching for the name of the channel = Amplitude and maximum track = number. For some reason, maximum has a range of values of 1 to 1, and this impedes my ability to research. When I try to look for another value out of reach, say Amplitude = 0.2, I get no results.  Is it possible that I can lift the restriction of the value or go around another way?

    I have attached a screengrab of research I am conducting, but also an example of data .tdms file.

    See you soon,.

    Ellie

    Hi Ellie,

    The file DDHN you posted doesn't have one Maximum or Minimum property registered in the channel ' entry/Amplitude voltage settings' (or another).  If you resave this tiara channel, it will be, but you must decide the best way to automatically fill properties.  The DataFinder cannot query a property whose value is defined on NoValue.

    What is confusing about this scenario, is that the tiara automatically calculates the properties Maximum and Minimum for each channel that is loaded in the data portal, it seems that these properties have values - when you load them in DIAdem, they do it.  But if you look at the table of properties DataFinder, according to Eva, you will see that the values are all NoValue.

    Here is a white paper that talks about a number of subjects like this:

    http://www.NI.com/white-paper/14252/en/

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • Is there a limit for research on the function of advanced search for files containing text matching. My search always ends with 500 discoveries but the folder contains several PDF files that match the criteria.

    Hello

    Is there a limit for research on the function of advanced search for files containing a text match? My search always ends with 500 discoveries but the folder contains several PDF files that match the criteria.

    Hi carls76936091,

    Open Acrobat, go to the Edit-> Preferences-> search & check if there is a limit to 500 set, in case if it is to increase it please.

    Kind regards
    Nicos

  • Advanced search in Reader 9 for packages w / embedded indexes created in Acrobat 8.1

    I'm having a terrible day.  I just finished combining thousands of documents in packages of 6 w / embedded index using Acrobat 8.1.  The advanced search feature allowed me to enter several names of peoples' Wilkes Terry White Smith Johnson and I could select to "Match any of the words" and I would be able to see all the documents mentioned any of these names.  The problem is that my boss doesn't have Reader 9 installed and its advanced search screen seems quite different for the nice advanced search screen that I can see.  I can't figure out how to get all the features of advanced search so he can use it.  If he enters several names 'Wilkes Terry White Smith', he gets no success because the system is assuming that I am looking for a person named "Wilkes Terry White Smith."  Is it possible to have the search find 'Match any of the words' rather than 'Match the exact phrase' using Reader 9.  I'm in trouble tomorrow.

    Is it possible to have the search find 'Match any of the words' rather than 'Match the exact phrase' using Reader 9.

    Yes; If the embedded index is always present and 'Search' rather than 'Find' is used.

    Edit > search rather than edit > find.

    The research requires the embedded index, or an index of catalog.

    If a PDF with the embedded index undergoes a "save under" the embedded index is deleted and the PDF file saved to support the quick display of Web pages.

    Be well...

  • How can I stop "Advanced search of Nation" to come whenever I open a new tab in Firefox under Mac OSX?

    Help! A few days previously, toolbar 'Advanced search Nation' (SIN) began to appear when I opened Firefox. I removed the SIN application of my computer that got rid of the toolbar, but now when I click to open a new tab, the tab opens with the URL of NAS. I was not able to prevent this. I downloaded and installed Firefox again, but that has not worked. I used the Spotlight to search for advanced search of Nation, but none were found. I hope someone can help me with this problem, and believe me when I say that I'll be very grateful for any help. Thank you.

    Use the searchreset tool and remove a user.js file as possible.

  • Advanced search and replace. How to replace the space with carriage return?

    10.9.13.0/24, 10.9.4.2/32, 10.9.4.3/32

    in

    10.9.13.0/24
    10.9.4.2/32
    10.9.4.3/32

    Find replace them ',' with carriage return.

    I still find articles on an advanced search and replace, but I can't seem to locate it.

    OS X El Capitan 10.11.3

    3.6.1 the numbers

    HI Brendan,

    You don't need an advanced find and replace for it.

    In the search box, press, then space.

    In the box replace by, press option-return.

    Then click Find and replace and find until you are finished.

    Kind regards

    Barry

  • Windows Update service does not and Outlook advanced search does not

    Have Vista Home Premium on an HP laptop. Running Norton Internet Security Antivirus and firewall.
    There is a month upgrade Office 2003 to Office 2010.
    With Office 2003, I used to give a list of updates, and I would choose where I wanted to, but noticed

    recently that I had no updates online. When I click on the button to make an update, nothing happens.
    In addition, advanced search in Outlook does not work, it ends in a microsecond and produces no result.

    Tried to change updates to not automatically updated, and then again on auto - no effect.
    Tried to go in safe mode and still couldn't do an update.
    Have run ccleaner and Tweaking.com Windows don't repair - no effect
    A ran a repair on Office 2010-no effect
    Have checked in that Crypto, BITS and Windows Update are all in automatic mode and Services are started.
    Have run the Fixit for update problems, - no effect.
    Running the program and got - Windows Update Standalone Installation Setup met with an error-0xc8000247
    Ran sfc/scannow and it brings just a search without search results window.

    Have noticed in the Event Viwer:
    In the Application logs:

    The Cryptographic Services service failed to initialize the catalog database. The ESENT error is:-583. ID 257.

    I also get a warning 1008 on:
    The Windows Search Service tries to remove the old catalog.

    and a 9000 error:
    The Windows Search Service cannot open the Jet property store.
    Details: The content index server cannot update or access information because of a database error.
    Stop and restart the search service.  If the problem persists, reset and recrawl the content index.  In some cases, it may be necessary to delete and recreate the content index.   (0x8004117f)
     
    and an error 1006:
    The Windows Search Service has not to create the search index creates. Internal error<4, 0x8004117f,="" failed="" to="" add="">
    C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Projects >.

    and warning 36:
    Research is unable to complete the indexing of your Outlook data. Indexing cannot continue to
    C:\Users\Bill\AppData\Local\Microsoft\Outlook\outlook.pst (error = 0 x 80304005). If this error persists,
    Contact Microsoft Support.

    And in the system logs:
    Error 7024
    The Windows Search service stopped with the special service 2147749155 (0x80040D23) error.

    Help. It makes me crazy!

    No probs.

    Though even this is not for your laptop, it has fast storage to Intel for chipset driver, it uses (ICH8M-E/M SATA AHCI Controller) you can see under the required System Configuration

    Here

    This is for XP 32/64 and Vista 32 / 64-bit. And Win7 32/64 bit

    It is version 10.1.2.1004. It may not be the latest version out at the mo. But his more later than the version installed

    You can either double-click SP52144, then follow what it says on the screen, then restart. Then see if WU works

    Or an extract SP51244 with something like 7-zip / winrar (select Extract to SP52144\). So, it extracts the files in folders.

    Then go to the entry SATA in DM. Go to the driver tab / driver update / browse computer / let me choose.

    Point to the folder that you extracted. Then the folder the folder drivers then the x 86. Since you are using 32-bit. And then click OK. It may show ICH8M-E/M (if it captures previous drivers / or if there is already an entry of controller for ICH8M-E/M). If you press ok / then following to load the drivers for it. Once he finished update the SATA drivers, restart

    Then see if windowsupdates works

    Looks like you need to .net framework 3.5 (or higher) for this. Don't think that you need this if you check out the file, and then add through the DM tho. If you double click on the file

  • How can I configure an option of advanced search in Windows 7?

    Original title: How do you get an option of advanced search in windows 7 as we could for earlier versions and calmly set your search?

    When I click in the main search field, that I want to set the the bottom of box main search to the left of the screen but he rockets off.

    It seems to be a limited selection of options that open up sometimes in blue under the search box which turns at the top of the right hand in Explorer can't see untial I put a word in the search box, sometimes just date arrives at other times can see other options such as the file.

    Did not work what to do to access these options.

    Reading on the advanced options, I see that I can type in the various symbols in the search.

    Is that what someone has produced an add on make life easier when searching?

    For example, I would first find the records to find files in folders by a specific word of the file type.

    Any suggestions welcome.

    CarbonFree.

    Hello

    Thanks for posting the question in the Microsoft Community forums.

    I see that you need to know more information on how to set-up an option of advanced search in Windows 7.

    Let's see a few articles and see how it works.

    Searching in Windows 7 can be as simple as typing a few letters in the search box, but there are also techniques of advanced search you can use. You don't have to know these techniques to search for your files, but they can be useful depending on where you are looking and what you are looking for.

    Advanced Tips for searching in Windows
    http://Windows.Microsoft.com/en-in/Windows7/advanced-tips-for-searching-in-Windows#section_2

    Searching in Windows: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows7/searching-in-Windows-frequently-asked-questions

    Find a file or folder

    http://Windows.Microsoft.com/en-us/Windows7/find-a-file-or-folder

    See also the step mentioned by "Shawn b. Keene [MVP] replied on September 19, 2010" in the article.

    In windows 7 - I want to find all files containing "a word or phrase in the file". The standard search XP box.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-files/in-Windows-7-i-want-to-search-for-all-files/aadfe1f1-4a33-406B-8e72-bb920efa4f30

    Hope this information helps. Get back to us if you have more queries about Windows.

  • I'm curious what is the email to inquire about the price range for the license for operating systems?

    I want to buy a Win 7 license. And wish to enquire prices for multiple licenses. I think buying a license 2 or 3 depending on the price range. I bought my Windows 7 through Amazon. And I'm looking for Win 7 license price but could not find a link to the Web page to inquire and buy a. I could demand more, but unfortunately is not for related businesses but for personal use. I like to custom build my own PC, because I don't see many advantages to a generic brand because some parts of the component of the PC is not what I'm looking for. I'm kind of giving detailed information, because I want someone to have the best idea of what type of license I may need.

    Thanks for the reply in advance.

    I thought that I found my solution... Andre thanks for trying to help.

    http://MLA.Microsoft.com/default.aspx
    I found the Microsoft license Advisor. And Volume License for up to 5 licenses or more.
    I'm just typing down if people look to the top of my post that they can find answers in the present.
    Thanks André<3>
    Although I noticed that the Web Microsoft License Advisor link have problems loading up. I guess it would be inconsistent to my current operating system Apple to work porperly...
    http://support.Microsoft.com/contactus/cu_sc_prodinfo_master
    I think it's the best information to find what I'm looking for...
    I noticed the other link does not work and this Internet link below works better
    http://www.Microsoft.com/licensing/existing-customers/product-activation-results.aspx?product=Windows%207
  • Issue of advanced search OFA

    Team,

    I have a table that has the following values

    INC.

    ----

    1234

    12345

    123456

    123

    I developed a page of the OFA with advanced search. The user enters the value, click on 'GO' assume that if the user enters the search value as '123' search then returns 123, 1234,12345,123456 so.

    If user enters '12345' that look up values, then it returns "12345" 123456 ". In my view, the system uses 'like' operator during the search. I want the result to the exact value. Could you please help.

    Hello

    Advanced search should have options for research.

    Users can choose options (contains, is equal to..) from the drop-down list box.

    Kind regards

    Anil

  • Advanced search in the 14 elements

    I want to do a search in a particular folder and its subfolder and sub-sub-folders.  However, all the research that I've tried return a search for each file in my system.  In help, it refers to the 'advanced search' and defines the 'Choose find > by using the advanced search. Advanced search bar displays unfortunately, it does not appear in the 'discovery' drop-down box. Can anyone advise me how I can do research, I need.

    GordonJar wrote:

    I want to do a search in a particular folder and its subfolder and sub-sub-folders.  However, all the research that I've tried return a search for each file in my system.  In help, it refers to the 'advanced search' and defines the ' choose find > using the advanced search. Advanced search bar displays unfortunately, it does not appear in the 'discovery' drop-down box. Can anyone advise me how I can do research, I need.

    That's what I wrote on the forum of elements Village now closed:

    "Organizer: select all files in the subfolders."

    Some users have complained that the option to display the contents of all subfolders in the folder has been removed

    Since the rewriting of the "Files" view

    http://feedback.Photoshop.com/photos...rlier_versions

    As you can see, there may be reasons to be able to select a folder AND all its subfolders content. For

    those who, like me, are not based on a structure of folders, but on categories and tags, there is no real need for the old

    feature, but given that many have a mixed workflow, here are my suggestions:

    Several solutions of workarounds depending on the structure of your file:

    -If you have a small number or subfolders, just assign one keyword common to all members of

    each subfolders (or place them in a common album)

    -There is a new option in the "Detail search" menu to select the files with a common text string in the subfolder

    name. With luck, you can select the set (which has worked for me for the subfolders from 2014).

    -My favorite one with the following steps:

    Organizer closed, I rename the main folder with a special suffix.

    I open the organizer and search for the missing files. I attribute a common to all the missing files label. I have quit smoking.

    Rename the folder master back and reopen the Organizer. And here, all of your files have a common label and you

    can select them.

    __________________

    Michel B.

    I hope this will help you.

  • Muse widget advanced search?

    I would like to create a new option of advanced search on my site of Muse, where the user selects what they find and then enters their zip code with the next nearest store on their search request products.

    Any tips? Muse has a widget? Or do you recommend a third party that offers widgets that can be imported?
    Thank you!

    Muse can't do it all. This stuff requires a database and a dynamic interface for logic.

    Mylenium

Maybe you are looking for