Referencing field in a query struct


about 5% of time error 'element companystatus undefined in q.' code in snippet 1. can tell me why ever error? if query returns 0 results (which may if user not logged in , session.user.getcompanyid() return 0) should return false since q.recordcount 0. problem know users in @ least cases logged in , query returning @ least 1 row. if statement should short circuit on record count if 0. if doesn't comparison q.companystatus should valid. know why cf flakes out when referencing q.companystatus? see in other areas such in snippet 2. method called cfc can guarantee passed argument '_company_id' valid integer , sql should return 1 result. why error 'element state undefined in q.' bad practice referencing query fields way?

thanks in advance

it looks me not running query?
i see no <cfquery> tag anywhere, sql statement text string...

in cf run sql statements inside <cfquery></cfquery> tag block (or
initiate stored procedure <cfstoredproc> tag...

azadi saryev
sabai-dee.com
http://www.sabai-dee.com/


More discussions in ColdFusion


adobe

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support