[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => PaulKD [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Inserting Structure Array into database - Coldfusion - Advanced Techniques

Inserting Structure Array into database - Coldfusion - Advanced Techniques

I am sure i am missing somehting simple but I can't seem to figure out what I am doing wrong. I am creating a structure array to hold information I am pulling from my database. This works fine. The problem I am having is when I try to put the data back into the database. I can get it to go in if the struct array does not have any empty stings. My question is how do I find out if a specific StructKey is empty. This way I can put in my update statement to put in the Structure ...

Sponsored Links
  1. #1

    Default Inserting Structure Array into database

    I am sure i am missing somehting simple but I can't seem to figure out what I
    am doing wrong.

    I am creating a structure array to hold information I am pulling from my
    database. This works fine. The problem I am having is when I try to put the
    data back into the database. I can get it to go in if the struct array does not
    have any empty stings.

    My question is how do I find out if a specific StructKey is empty. This way I
    can put in my update statement to put in the Structure or 'NULL' into the
    database.

    Thanks in advance for your help.
    jmoshier

    Sponsored Links
    jmoshier Guest

  2. #2

    Default Re: Inserting Structure Array into database

    Look for an empty string.

    Originally posted by: jmoshier
    I am sure i am missing somehting simple but I can't seem to figure out what I
    am doing wrong.

    I am creating a structure array to hold information I am pulling from my
    database. This works fine. The problem I am having is when I try to put the
    data back into the database. I can get it to go in if the struct array does not
    have any empty stings.

    My question is how do I find out if a specific StructKey is empty. This way I
    can put in my update statement to put in the Structure or 'NULL' into the
    database.

    Thanks in advance for your help.
    jmoshier



    Dan Guest

  3. #3

    Default Re: Inserting Structure Array into database

    I realize I need to look for the empty string but how is my question. I know there is ArrayIsEmpty() and StructIsEmpty() put neither will check if a specific StructKey is empty.
    jmoshier Guest

  4. #4

    Default Re: Inserting Structure Array into database

    the value of a structkey is no different than any other variable....

    simply test the length

    Hope I've understood the question
    :)

    <cfif len(mystruct.foo1.foo2.foo3.foovalue)>
    <!---there's data in the structkey--->
    <cfelse>
    <!---it's empty--->
    </cfif>

    PaulKD Guest

  5. #5

    Default Re: Inserting Structure Array into database

    if (array[index] = '') // it's an empty string
    if (structure.key = '' ) // it's an empty string

    Originally posted by: jmoshier
    I realize I need to look for the empty string but how is my question. I know
    there is ArrayIsEmpty() and StructIsEmpty() put neither will check if a
    specific StructKey is empty.



    Dan Guest

  6. #6

    Default Re: Inserting Structure Array into database

    Dan,

    Like me (and many others) you've put an = in ColdFusion when you know it's EQ or IS ;)
    PaulKD Guest

Similar Threads

  1. Database structure decision
    By Mikee in forum MySQL
    Replies: 15
    Last Post: February 2nd, 05:56 PM
  2. structure/array gurus - a challenge for you
    By Lossed in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: April 25th, 04:07 PM
  3. Sorting an Array containing a structure...
    By ultrafresh in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: April 8th, 02:59 PM
  4. Array Structure for Application State Variable?
    By Kevin Spencer in forum ASP.NET General
    Replies: 0
    Last Post: July 14th, 07:00 PM

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
  •