[ic] [if data database::fieldname::key] statement

Ed LaFrance interchange-users@lists.akopia.com
Mon Jul 9 12:03:00 2001


At 11:44 AM 07/09/2001 -0400, you wrote:
>I need to check if a field in a database has a value. If it does, I would
>like to display it and if it doesn't I don't want it displayed. I am trying
>to use the
>[if data database::name::myName] command but it seems to work only if the
>key 1.) has no spaces 2.)is short with a space. (I defined the key to be
>varchar(50) ) I believe this is the problem because i inserted a couple of
>test values into the database, and the above command would work for names
>like 'test', 'test space', 'testlongnamewithoutaspace' but would not work
>for values of 'testlongname withspace' and 'testlongername space'. I do not
>understand?!?! Can anyone help me out? Is there another way i can do this?
>Thanks.
>
>don
>
>ps. here is the code i need to get working for ALL cases
>
>[if database::name::testlongnameherewithoutspace]
>THIS WORKS <br> [item-field testlongnamewithoutspace]
>[/if]
>

Try the named syntax:

[if type=data term="database::fieldname::key value"]
         true
[/if]

- Ed L.




===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================