Professional Web Applications Themes

Missing something in this query - Coldfusion Database Access

have a list of symptoms - I want a user to be able to click on the first letter of their symptom. Next a list of all the symptoms with the corresponding letters are pulled from the database. Actually have got a drop down (distinct) working for this but on the result page i get all the results - think it isnt filtering properly - i have also tried removing the first % in %#FORM.Letter#%' but to no avail. click A - list of A with check box in addition i would like a check box to be placed next ...

  1. #1

    Default Missing something in this query


    have a list of symptoms - I want a user to be able to click on the
    first letter of their symptom. Next a list of all the symptoms with
    the corresponding letters are pulled from the database. Actually have
    got a drop down (distinct) working for this but on the result page i get all
    the
    results - think it isnt filtering properly - i have also tried removing the
    first % in %#FORM.Letter#%'
    but to no avail.

    click A - list of A with check box

    in addition i would like a check box to be placed next to each symptom.
    <Got this happening too> #Thanks Dan

    Problem: Result page pulls all the entries and doesnt sort by the
    distinct query from the search page
    Would most appreciate some help(again)
    regards the nOOb


    Search page
    <cfquery name="SymptomS" datasource="Symptom">
    SELECT Distinct Letter
    FROM tsymptommaster
    </cfquery>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Doent</title>
    </head>

    <form name="SymptomS" method="post" action="ResultSymptom.cfm">

    <input type="submit" name="Submit" value="Submit">
    <select name="symptom">
    <cfoutput query="SymptomS">
    <option value="#SymptomS.Letter#" <cfif
    (isDefined("SymptomS.Letter") AND SymptomS.Letter EQ
    SymptomS.Letter)>selected</cfif>>#SymptomS.Letter#</option>
    </cfoutput> </select>
    </form>
    </html>

    result page
    <cfparam name="FORM.Letter" default="1"><cfquery name="q1"
    datasource="Symptom">
    select symptom
    from tsymptommaster
    </cfquery>
    <cfquery name="q2" datasource="Symptom">
    SELECT *
    FROM tsymptommaster
    WHERE Letter LIKE '%#FORM.Letter#%'</cfquery>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Result Symptom</title>
    </head>

    <cfoutput query="q2">
    <input type="checkbox" name="symptomidlist" value="#symptom#">

    symptom</cfoutput>
    </html>



    quiero mas Guest

  2. #2

    Default Re: Missing something in this query

    How many symptons are we talking about anyway?

    Also, if a user of your site does everything right, what should he eventually see?

    Originally posted by: quiero mas
    have a list of symptoms



    Dan Bracuk Guest

  3. #3

    Default Re: Missing something in this query

    ?i Dan - Quick run down
    1. multilingual
    2. 250 symptoms in each language
    3. for the moment just trialing in two. Japanese and English

    objective
    1. user can click on the first letter of the symptom they think the have
    2. then a list of all the associated symptoms is displayed with a check box
    next to it.
    3. they choose one of more of the symptoms and submit this to another page.
    4. i want it to be possible to go back to the index page and click on another
    letter

    e.g my symptoms: headache and backache

    first i click on h - check headache then submit it to an intermediary page
    second return to the index page click b check backache the nmove on to the
    page where headache has also been sent.

    the user then completes some personal information and medical history
    next they can print and/or Email their information a participating Hospital,
    Pharmacy or Clinic.
    As you know this is a voluntary project so i am learning everything myself and
    as you have probably worked out with very little background experience. Ive
    been over here since 1996 so i have a good knowledge of Japanese and
    translation so that sideis a breeze compared to this.

    Thanks again for you patience Dan and others

    Regards Mark

    quiero mas Guest

  4. #4

    Default Re: Missing something in this query

    If your database supports substrings, do this on the first page

    select distinct substr(sympton, 1, 1) firstletter
    from symptons

    <cfoutput query="q1">
    <a href="page2?letter=#firstletter#">#firstletter#

    Then on page2, do this

    select symptom from symptons
    where symptom like '#url.firstletter%#'

    and so on.
    Originally posted by: quiero mas
    ?i Dan - Quick run down
    1. multilingual
    2. 250 symptoms in each language
    3. for the moment just trialing in two. Japanese and English

    objective
    1. user can click on the first letter of the symptom they think the have
    2. then a list of all the associated symptoms is displayed with a check box
    next to it.
    3. they choose one of more of the symptoms and submit this to another page.
    4. i want it to be possible to go back to the index page and click on another
    letter

    e.g my symptoms: headache and backache

    first i click on h - check headache then submit it to an intermediary page
    second return to the index page click b check backache the nmove on to the
    page where headache has also been sent.

    the user then completes some personal information and medical history
    next they can print and/or Email their information a participating Hospital,
    Pharmacy or Clinic.
    As you know this is a voluntary project so i am learning everything myself and
    as you have probably worked out with very little background experience. Ive
    been over here since 1996 so i have a good knowledge of Japanese and
    translation so that sideis a breeze compared to this.

    Thanks again for you patience Dan and others

    Regards Mark



    Dan Bracuk Guest

  5. #5

    Default Re: Missing something in this query

    The advice and your time is much appreciated. Ill do some research into these.

    Thanks alot
    Regards Mark
    quiero mas Guest

  6. #6

    Default Wrong

    Couldnt agree less. Totally off the chart. You can PM if you want, I
    will try to explain better...

    finger5844 Guest

Similar Threads

  1. Replies: 0
    Last Post: September 27th, 04:57 PM
  2. Fields missing in query
    By Robert10 in forum Coldfusion Database Access
    Replies: 1
    Last Post: March 20th, 05:52 PM
  3. Query of Query Missing Some Data
    By g1zm0guy in forum Coldfusion Database Access
    Replies: 7
    Last Post: January 17th, 09:30 AM
  4. SQL query missing only date data elements
    By Jared13 in forum Coldfusion Database Access
    Replies: 1
    Last Post: January 12th, 04:21 PM
  5. Access: (missing operator) in query expression
    By Bob the ASP Builder in forum ASP Database
    Replies: 1
    Last Post: February 12th, 05:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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