HighDots Forums  

Show if database field contains text

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Show if database field contains text in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RJames
 
Posts: n/a

Default Show if database field contains text - 11-19-2004 , 09:52 PM






Hello,

I am working on a web site in ASP. I want to show a portion of the
page if the databse field contains a certain word. I know how to
display something if the field is empty or not empty, but I want to
display something if the field contains the word "none" anywhere in
the body of text.

Here's the code I'm trying. I thought I could use the LIKE command,
but to no avail:

<% if Recordset1.Fields.Item("strEduMaterials").Value LIKE "none" then
%>


Any suggestions?

Thanks!

Randy

Reply With Quote
  #2  
Old   
Jeff North
 
Posts: n/a

Default Re: Show if database field contains text - 11-20-2004 , 03:35 AM






On 19 Nov 2004 18:52:39 -0800, in macromedia.dreamweaver
randy (AT) mindson (DOT) com (RJames) wrote:

Quote:
| Hello,
|
| I am working on a web site in ASP. I want to show a portion of the
| page if the databse field contains a certain word. I know how to
| display something if the field is empty or not empty, but I want to
| display something if the field contains the word "none" anywhere in
| the body of text.
|
| Here's the code I'm trying. I thought I could use the LIKE command,
| but to no avail:
|
| <% if Recordset1.Fields.Item("strEduMaterials").Value LIKE "none" then
| %
What database are you using?

Mysql etc:
<% if Rs.Fields.Item("strEduMaterials").Value LIKE % 'none' % then
%>

MsAccess:
<% if Rs.Fields.Item("strEduMaterials").Value LIKE * 'none' * then
%>

---------------------------------------------------------------
jnorth (AT) yourpantsbigpond (DOT) net.au : Remove your pants to reply
---------------------------------------------------------------


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.