select any data from category

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default select any data from category

    Hi everyone - in the following code i want to allow the user t choose 'any'.

    Example
    choose the area - central
    language - any
    department - Bronchoesopagology


    I dont want the user to have the option for area but it would be useful for
    the other categories.

    <cfquery name="urlpass" datasource="dependent">
    SELECT hospital_name, hospital_id, EnglishAddress, JapaneseAddress,
    NihongoName
    FROM tHHbyL
    WHERE group_id = '#form.area#'
    <!--- eg. English = '-1' --->
    AND #form.Language# = -1
    AND #form.Department# = -1
    </cfquery>

    by the way this is a triple drop down menu where the menus are not populated
    depending on the previous choice.

    Regards Mark

    quiero mas Guest

  2. Similar Questions and Discussions

    1. components: 4 Millions Domains data with Category
      Successfull Internet and Direct Marketing products on www.promotionsite.net * NEW * DOMUS Domains Toolkit Fall 2004 - Unique on the Net 4...
    2. buildingcontrols: 4 Millions Domains data with Category
      Successfull Internet and Direct Marketing products on www.promotionsite.net * NEW * DOMUS Domains Toolkit Fall 2004 - Unique on the Net 4...
    3. flash: 4 Millions Domains data with Category
      Successfull Internet and Direct Marketing products on www.promotionsite.net * NEW * DOMUS Domains Toolkit Fall 2004 - Unique on the Net 4...
    4. [PHP] Category and sub-category logic
      Ryan A <mailto:ryan@jumac.com> on Thursday, August 14, 2003 3:21 PM said: Read this http://www.sitepoint.com/article/1105 and you will know what...
    5. Category and sub-category logic
      Hi, I am thinking of making a program for personal use which does a very simple thing, just displays listings under categories, eg: under main...
  3. #2

    Default Re: select any data from category

    The values are all numeric, set by selects?

    If so, then your "any" choices should set values of "" or " " or "any".
    (Don't use a magic number!)


    Then the query becomes:

    WHERE group_id = '#form.area#'
    <!--- Either select a specific language or ALL languages. --->
    <CFIF IsNumeric (form.Language)>
    AND language_id = <CFQUERYPARAM cfsqltype="cf_sql_integer"
    value=#form.Language#>
    </CFIF>

    <!--- Either select a specific department or ALL departments. --->
    <CFIF IsNumeric (form.Department)>
    AND language_id = <CFQUERYPARAM cfsqltype="cf_sql_integer"
    value=#form.Department#>
    </CFIF>



    MikerRoo Guest

  4. #3

    Default Re: select any data from category

    Oopsie!

    The second condition should read:
    AND department_id = <CFQUERYPARAM cfsqltype="cf_sql_integer" value=#form.Department#>
    MikerRoo Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139