I'm trying to add a new record, and at the same time, pull some information from another table rather than having the user fill it in again. Can someone direct me as to where I'm going wrong?
Add Page: Before Display
global $conn;
$strSQLSelect = "SELECT Emp_FirstName, Emp_LastName, Emp_EmailAddress, Emp_BranchID FROM Employees WHERE Emp_Username = '".$_SESSION["UserID"]."'";
$rsSelect = db_query($strSQLSelect,$conn);
$data=db_fetch_array($rsSelect);
$xt->assign("Emp_FirstName", $data["Emp_FirstName"]);
$xt->assign("Emp_LastName", $data["Emp_LastName"]);
$xt->assign("Emp_EmailAddress", $data["Emp_EmailAddress"]);
$xt->assign("Emp_BranchID", $data["Emp_BranchID"]);