[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => a440guy [ip] => anderson@mitre. [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] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => OldCFer [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] => ) --> Indirect recordcount - Macromedia ColdFusion

Indirect recordcount - Macromedia ColdFusion

I have a variable that contains the name of a query. How can I get the RecordCount for that query? I've tried using Evaluate() in several different ways, but I can't find one that works. In the example code, I would like to be able to find the recordcount for the query whose name is the value of queryname. I've tried the syntax shown in the example and I've tried 'evaluate(#queryname#.recordcount), and also 'evaluate(#evaluate(#queryname#.recordcount)#), which looks ridiculous! <cfloop index="dept_no" list="#dept_list#"> <cfset queryname = "dept_" & dept_no> <cfquery name="#queryname# datasource="#DSN#"> <!--- SQL goes here ---> </cfquery> <cfif #queryname#.recordcount eq 0> <!--- ...

  1. #1

    Default Indirect recordcount

    I have a variable that contains the name of a query. How can I get the
    RecordCount for that query? I've tried using Evaluate() in several different
    ways, but I can't find one that works. In the example code, I would like to be
    able to find the recordcount for the query whose name is the value of
    queryname. I've tried the syntax shown in the example and I've tried
    'evaluate(#queryname#.recordcount), and also
    'evaluate(#evaluate(#queryname#.recordcount)#), which looks ridiculous!



    <cfloop index="dept_no" list="#dept_list#">
    <cfset queryname = "dept_" & dept_no>
    <cfquery name="#queryname# datasource="#DSN#">
    <!--- SQL goes here --->
    </cfquery>

    <cfif #queryname#.recordcount eq 0>
    <!--- do something --->
    </cfif>
    </cfloop>

    a440guy Guest

  2. #2

    Default Re: Indirect recordcount

    <CFIF queryname.recordcount is '0'> blah blah</cfif>
    In the cfif statement you don't need the pound signs.
    If you want to see as an output how many records in a query
    <cfoutput>#queryname.recordcount#</cfoutput>
    Hope this helps.
    j

    jmj Guest

  3. #3

    Default Re: Indirect recordcount

    Sorry, jmj, but that doesn't help. You missed it.

    'queryname' is NOT the name of the query, it is a variable containing the name of the query.
    a440guy Guest

  4. #4

    Default Re: Indirect recordcount

    Use:

    <cfif NOT Evaluate(queryname & ".recordcount")>
    <!--- do something --->
    </cfif>

    OldCFer Guest

  5. #5

    Default Re: Indirect recordcount

    Ah!! Of course! I should have known that. I guess 6 months away from CF has taken it's toll.

    Thank you so much.!
    a440guy Guest

Similar Threads

  1. #40625 [NEW]: Indirect modification of overloaded property
    By noreply@php.net in forum PHP Bugs
    Replies: 1
    Last Post: February 25th, 07:35 PM
  2. Indirect file upload undoented feature?
    By topmind in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: July 18th, 05:49 PM
  3. Indirect Selection tool doesn't always work
    By Aaron_Merritt@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 3
    Last Post: April 25th, 11:30 PM
  4. indirect file access
    By Aerfx in forum PERL Beginners
    Replies: 1
    Last Post: November 9th, 07:45 PM
  5. an indirect ASP security problem
    By Adam Lawson in forum ASP.NET Security
    Replies: 0
    Last Post: September 4th, 11:41 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
  •