It seems like my code works to check for null if I do
if ($tx)
or
if (isset($tx))
why would I do the se
Because the former could also check for true/false, which you may or may not want.