dynamic text revisted

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

  1. #1

    Default dynamic text revisted

    Just cant seem to get to the next step


    Dans advice
    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 symptoms
    where symptom like '#url.firstletter%#'

    Hi ive tried everything i can think of - fiddle and modified this n that.
    The error i kep getting is to do with substr
    Im using access as my database

    Table name: symptoms
    fields
    symptom_ID, firstletter, symptom
    1 A Ache, Back

    *symptomsearch page code

    <cfquery name="q1" datasource="symptom">
    select distinct substr(symptom, 1, 1) firstletter
    from symptoms
    </cfquery>


    <html>
    <head>
    <title>Untitled Document</title>
    </head>
    <cfoutput query="q1">
    <a href="ResultSymptom?letter=#firstletter#">#firstle tter#
    <a href="ResultSymptom.cfm">A</a> <a href="ResultSymptom.cfm">B</a> <a
    href="ResultSymptom.cfm">C</a> </cfoutput>

    </html>

    #as you can see i have made each letter a hyperlink to the Resultsymptom page

    *Result symptom page code

    <cfparam name="FORM.firstletter" default="1">
    <cfparam name="PageNum_q3" default="1">
    <cfquery name="q2" datasource="symptom">
    SELECT firstletter
    FROM symptoms
    </cfquery>
    <cfquery name="q3" datasource="symptom">
    select symptom
    from symptoms
    where symptom like '#url.firstletter%#'
    </cfquery>



    </head>
    <input type="checkbox" name="checkbox" value="checkbox">

    <cfoutput>#q3.symptom#</cfoutput>
    </html>

    No doubt i have missed something important.
    Regards Mark


    quiero mas Guest

  2. Similar Questions and Discussions

    1. load external text to dynamic text field in levels
      Dear Sir I found the Tech Noe Index #16238 is useful in creating dynamically loaded text from external text file. However, the method mentioned...
    2. Dynamic text box within dynamic movie clip
      I'm having a similar problem. On mine I noticed that although the text doesn't show and the border doesn't show, the cursor changes appropriately...
    3. How to center text in dynamic HTML text field ???
      In Flash MX 2004 I suddenly find myself comletely helpless trying to align all text to the center in my dynamic text field. I dont recall running...
    4. Dynamic text fields. Continuing text over columns
      Hi I'm doing a mock up news paper article over 4 columns in flash mx and the text loads in dynamically. I have 4 dynamic text boxes sitting side...
    5. Dynamic Text Loaded from Text files -> Flash 5 <-
      I was wondering how I can dynamically load text into a text box from a text file using Flash 5. I've seen plenty infos how to do it with Flash MX but...
  3. #2

    Default Re: dynamic text revisted

    Your problem is here:
    where symptom like '#url.firstletter%#'

    Put the percentage sign after the 2nd octothorp.

    On your search page, you have too much code when displaying your hyperlinks.
    After this line:
    <a href="ResultSymptom?letter=#firstletter#">#firstle tter#
    put in your closing tags for the anchor and cfoutput.

    Dan Bracuk Guest

  4. #3

    Default Re: dynamic text revisted

    ?????????????????????????????????????????????????? ??????????????????????????????
    ?
    Sorry Dan still getting this

    Query error - 'substr(symptom, 1, 1) firstletter'

    Page 1

    <cfquery name="q1" datasource="symptom">
    select distinct substr(symptom, 1, 1) firstletter
    from symptoms
    </cfquery>




    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    </head>
    <body>
    <cfoutput query="q1">
    <a href="ResultSymptom?letter=#firstletter#">#firstle tter#
    <A> <B> <C>
    </cfoutput>
    </body>
    </html>

    Page 2

    <cfparam name="FORM.firstletter" default="1">
    <cfparam name="PageNum_q3" default="1">
    <cfquery name="q2" datasource="symptom">
    SELECT firstletter
    FROM symptoms
    </cfquery>
    <cfquery name="q3" datasource="symptom">
    select symptom
    from symptoms
    where symptom like '#url.firstletter#%'
    </cfquery>



    <html>
    <head>
    <title>ResultSymptom</title>
    <style type="text/css">
    <!--
    .style1 {color: #FF6600}
    -->
    </style>
    </head>
    <input type="checkbox" name="checkbox" value="checkbox">

    <cfoutput>#q3.symptom#</cfoutput>
    </html>


    quiero mas Guest

  5. #4

    Default Re: dynamic text revisted

    Should it be like this ??
    select distinct substr(symptom, 1, 1) AS firstletter
    zoeski80 Guest

  6. #5

    Default Re: dynamic text revisted

    Weren't you using (horrors) MS Access? :D

    If so then the subtring function is not called that.

    Use:
    <cfquery name="q1" datasource="symptom">
    select distinct mid (symptom, 1, 1) AS firstletter
    from symptoms
    order by mid (symptom, 1, 1)
    </cfquery>

    or better yet:
    <cfquery name="q1" datasource="symptom">
    select distinct left (symptom, 1) AS firstletter
    from symptoms
    order by left (symptom, 1)
    </cfquery>



    MikerRoo Guest

  7. #6

    Default Re: dynamic text revisted

    ???????everyone - yeah horrors access thats right - im going to get onto mysql
    - in the very near future - good idea?
    How is the learning curve? I m the kind of person who takes a while to learn
    something but that doesnt give once i started

    Any advice in this area - what database to choose etc -

    Regards

    quiero mas Guest

  8. #7

    Default Re: dynamic text revisted

    Is this question answered or not?

    Anyway, Access is actually a good platform to learn on if you ask yourself why
    the wizards and analyzer tools do what they do and recommend what they
    recommend.

    The best DB question is a highly charged "religeous" question -- best suited
    for another post.

    MikerRoo Guest

  9. #8

    Default Re: dynamic text revisted

    Not quite answered sorry mikeroo (u an aussie?)
    1. on the select page
    the A to Z appears and is clickable thank you
    2. unfortunately when u click on a letter the message unknown page

    3. On the result page if i preview it in the browser i get a message to the
    effect (since my os is in Japanese)

    that there is some kind if problem with first letter and url.

    the codes

    first page

    <cfquery name="q1" datasource="symptom">
    select distinct left (symptom, 1) AS firstletter
    from symptoms
    order by left (symptom, 1)
    </cfquery>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    </head>
    <cfoutput query="q1">
    <a href="ResultSymptom?letter=#firstletter#">#firstle tter#
    </cfoutput>

    </html>

    next page

    <cfparam name="FORM.firstletter" default="1">
    <cfparam name="PageNum_q3" default="1">
    <cfquery name="q2" datasource="symptom">
    SELECT firstletter
    FROM symptoms
    </cfquery>
    <cfquery name="q3" datasource="symptom">
    select symptom
    from symptoms
    where symptom like '#url.firstletter#%'
    </cfquery>



    </head>
    <input type="checkbox" name="checkbox" value="checkbox">

    <cfoutput>#q3.symptom#</cfoutput>

    quiero mas Guest

  10. #9

    Default Re: dynamic text revisted

    Not an Australian. Just an idiot who often works Aussie (or more precisely,
    Indian) hours.

    On the first page, shouldn't this:

    <a href="ResultSymptom?letter=#firstletter#">#firstle tter#

    be this:
    <a href="ResultSymptom.cfm?firstletter=#firstletter#" >#firstletter#</a>

    On the next page:
    Delete query "q2" and change this:
    <cfparam name="FORM.firstletter" default="1">

    to this:
    <cfparam name="URL.firstletter" default="Z">


    MikerRoo Guest

  11. #10

    Default Re: dynamic text revisted

    Thanks alot to both Dan and MIkeroo fpr all their help on this problem
    It is working well
    Regards Mark
    quiero mas 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