Search And Html Tag ????
-
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.
-
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.
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
-
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
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
-
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
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.
-
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.
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