i would start the session on whichever page needs to use the session variable.
(on the page supplied, you have added the lines
<?php
if (!isset($_SESSION)) {
session_start();
}
?>
twice, at the start and again on lines 47, you should do this once, at or near the top of the page)
set a session variable like this...
<?php
$_SESSION["whatever"] = $your_variable;
?>
so you could use your recordset value here, but ensure the recordset has been created before you set the session variable.
when starting, i find it good practice to echo the variable, to ensure it is being set ok.
<?php
echo 'session variable is '.$_SESSION["whatever"];
?>
hope this helps