SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    output only after <br>

    Code:
    data in the record 1 of myTable
    I am a boy<br>
    He is good
    I have the above data value in myTable. Let's see the below CFML code and its result.

    Code:
    CFML code
    <cfquery datasource="DS" name="test">
    	select ID, message
    	from myTable	
    	where ID=1
    </cfquery>
    
    <cfoutput query="test">
        #message#
    </cfoutput>
    
    its result
    I am a boy
    He is good
    I like to output only the words which is followed by <br>.
    my target result would be the following.
    Code:
    target result
    He is good


    Thanks in Advance

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Code:
    <cfoutput query="test">
      <cfif FindNoCase('<br>',test.message)>
        #Right(test.message, Len(test.message)
                              - FindNoCase('<br>',test.message)
                              - 3)
      <cfelse>#test.message#</cfif>
    </cfoutput>
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •