well, in addition to changing the global reference, you also needed to change the code for the email address column:
<?php echo $row_SecurityAssistusers['UserEmail']; ?>
to use the correct recordset name:
<?php echo $row_SecurityAssisttblusers['UserEmail']; ?>
using a session should be fine to. that is what is used for the random String and ID.