LAdProg2005
Programmer
Hello,
I am fairly new to coldfusion...I am converting scripts from php to coldfusion.
two of the functions in php (list() & each ())
I cannot find in coldfusion...Not exact but similar functions...
I will appreciate any pointers in this regards...basically what i am trying to do is
i have structure populated from the results of query and to i need to loop through it accodingly
i.e. info->structure from three queries: info[txt][loc][year][day]['test1']=totalNum;
info[txt][loc][year][day]['test2']=totalNum;
info[txt][loc][year][day]['test3']=totalNum
when i dump this structure in coldfusion:
result:
cmp1->il->2009->03->test1(1)test2(1)test3(1)
tx->2009->03->test1(2)test2(2)test3(2)
ny->2009->02->test1(1)test2(1)test3(1)
&
cmp2->il->2009->03->test1(1)test2(1)test3(1)
tx->2009->03->test1(1)test2(1)test3(1)
ny->2009->03->test1(1)test2(1)test3(1)
---following is what i need to do but i am having hard time to write it in coldfusion----
while (list ($txt, $vtxt) = each ($info)){
while (list ($loc, $vloc) = each ($info[$loc])) {
do something
}
}
Thanks,
p
I am fairly new to coldfusion...I am converting scripts from php to coldfusion.
two of the functions in php (list() & each ())
I cannot find in coldfusion...Not exact but similar functions...
I will appreciate any pointers in this regards...basically what i am trying to do is
i have structure populated from the results of query and to i need to loop through it accodingly
i.e. info->structure from three queries: info[txt][loc][year][day]['test1']=totalNum;
info[txt][loc][year][day]['test2']=totalNum;
info[txt][loc][year][day]['test3']=totalNum
when i dump this structure in coldfusion:
result:
cmp1->il->2009->03->test1(1)test2(1)test3(1)
tx->2009->03->test1(2)test2(2)test3(2)
ny->2009->02->test1(1)test2(1)test3(1)
&
cmp2->il->2009->03->test1(1)test2(1)test3(1)
tx->2009->03->test1(1)test2(1)test3(1)
ny->2009->03->test1(1)test2(1)test3(1)
---following is what i need to do but i am having hard time to write it in coldfusion----
while (list ($txt, $vtxt) = each ($info)){
while (list ($loc, $vloc) = each ($info[$loc])) {
do something
}
}
Thanks,
p