Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Search And Html Tag ????

Search And Html Tag ????

Scheduled Pinned Locked Moved Database
databasetutorialhtmlhelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    god4k
    wrote on last edited by
    #1

    Dear Sir and Madam I create a webboard. After User Post, the message will be added to the table in Sql database. My webboard allow user to post html tag. This is the example of my problem. when search the row that contain 'td', the row that contain '<td>hello</td>' and 'hello td' are returned. Do you know how to return the the row that contains 'hello td' only? Please give me an idea. Thank You. Sorry for bad English.

    P 1 Reply Last reply
    0
    • G god4k

      Dear Sir and Madam I create a webboard. After User Post, the message will be added to the table in Sql database. My webboard allow user to post html tag. This is the example of my problem. when search the row that contain 'td', the row that contain '<td>hello</td>' and 'hello td' are returned. Do you know how to return the the row that contains 'hello td' only? Please give me an idea. Thank You. Sorry for bad English.

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      god4k wrote:

      Do you know how to return the the row that contains 'hello td' only?

      SELECT * FROM mytable WHERE myfield = 'hello td' But this doesn't make sense. 'hello td' isn't valid HTML markup. Is this definitely what you want to do?

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      P G 2 Replies Last reply
      0
      • P pmarfleet

        god4k wrote:

        Do you know how to return the the row that contains 'hello td' only?

        SELECT * FROM mytable WHERE myfield = 'hello td' But this doesn't make sense. 'hello td' isn't valid HTML markup. Is this definitely what you want to do?

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #3

        pmarfleet wrote:

        But this doesn't make sense. 'hello td' isn't valid HTML markup. Is this definitely what you want to do?

        Your guess is probably as good as mine...

        "The clue train passed his station without stopping." - John Simmons / outlaw programmer

        1 Reply Last reply
        0
        • P pmarfleet

          god4k wrote:

          Do you know how to return the the row that contains 'hello td' only?

          SELECT * FROM mytable WHERE myfield = 'hello td' But this doesn't make sense. 'hello td' isn't valid HTML markup. Is this definitely what you want to do?

          Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

          G Offline
          G Offline
          god4k
          wrote on last edited by
          #4

          You don't understand me. Please see this example. When user search the rows that contain 'a' in webboard, only the following row should returend. 1. I see a dog run 2. give me my bag 3. I will pass this message on 4. ..... 5. ..... and the following row should not returned. 6. <a href="codeproject.com">codeproject</a> 7. <a href="link.com">hello</a> 8. ..... 9. ..... Please give me any idea. Thank You.

          P 1 Reply Last reply
          0
          • G god4k

            You don't understand me. Please see this example. When user search the rows that contain 'a' in webboard, only the following row should returend. 1. I see a dog run 2. give me my bag 3. I will pass this message on 4. ..... 5. ..... and the following row should not returned. 6. <a href="codeproject.com">codeproject</a> 7. <a href="link.com">hello</a> 8. ..... 9. ..... Please give me any idea. Thank You.

            P Offline
            P Offline
            pmarfleet
            wrote on last edited by
            #5

            You would have to perform some pattern matching, checking whether the string of characters formed part of a tag. T-SQL pattern matching doesn't have the capability to do this. However you could write a CLR stored procedure and invoke the regular expression functionality in the .NET framework to perform the match.

            Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups