Very basic Data Output question

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Very basic Data Output question

    I have an MSAccess database with a text field named 'field1'. The value of the
    records in that table are formatted as follows: #dynamic# red widgets #dynamic#
    blue widgets blue #dynamic# widgets etc.... When I pull the records from the
    DB, I am outputting in a list. <cfset dynamic='myValue'> <cfloop
    index='theField' query='myQuery'> <cfoutput> #theField# </cfoutput>
    </cfloop> My problem is that the output displays as: #dynamic# red widgets
    #dynamic# blue widgets blue #dynamic# widgets When I need it to display as:
    myDynamic red widgets myDynamic blue widgets blue myDynamic widgets Is there a
    formatting option that will allow this database field to output with the
    #dynamic# value resolved in the page? Thanks much. roblaw

    roblaw Guest

  2. Similar Questions and Discussions

    1. Basic question about saving data
      Hey everybody, I am new to Flex and am learning slowly. Some of this stuff is very foreign to me but once I grasp the basic concepts, I am sure...
    2. Basic Problems with data
      Hi all, Sorry that this is such a basic question - I just can't seem to find the answer or the way of doing it myself! I'm pretty new to Flash...
    3. basic data read and put it on web form
      i'm trying to read data from SQL Server database using data reader and assigned it to a label in my asp.net web application. but when the button is...
    4. ASP.NET and SSL basic question.
      Hi, Apologies if this question is a bit basic, but I can't seem to find any documentation anywhere. I have an asp.net site running on Windows...
    5. basic css question
      In several of my posts lately, I have made it known that I am nto a huge fan of using newer stuff as opposed to older methods of getting things...
  3. #2

    Default Re: Very basic Data Output question

    Hi Roblaw, Your explanation of what you are trying to do is not clear. But,
    the cfloop/query only takes the queryname and optionally the start and end row.
    There is no index using the query form of cfloop. Cfoutput takes a query
    attribute and will then loop throw each row of your result. So your code
    probably needs to look more like:

    <cfoutput query="myQuery">
    #field1#
    </cfoutput>

    or possibly:
    <cfloop query="myQuery">
    <cfoutput>
    #myQuery.field1#
    </cfoutput>
    </cfloop>

    ksmith 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