User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
Once again you have provided the group with RANDOM pieces of code,
completely out of context since you have already shown me that your
query and db connection are being used in a function, hence your loss of
$cxn.