以下是 HSHY.php 的代码我想将表行内容显示为此主页上的标题,但它仍然无法从连接文件中检索数据
<header>
<h2><?php echo $_SESSION['company'] ?></h2>
<p>Current User: <?php echo $_SESSION["username"]; ?><a href="logout.php">[Logout]</a></p>
</header>
&#13;
if (isset($_POST['HSHY'])){
$link_mssql = odbc_connect(HOST_HSHY,DB_USER,DB_PASS);
$company= '';
$sql = "SELECT Name FROM CompanyProfile ";
$rs = odbc_exec($link_mssql,$sql);
while (odbc_fetch_row($rs)) {
$company=odbc_result($rs,"Name");
}
$_SESSION['company']=$company;
header("location: HSHY.php"); // Redirecting To Other Page
odbc_close($link_mssql); // Closing Connection
//echo $company ;
// Initializing Session
}
&#13;