當一個人登錄時,只有他可以看到他的個人數據。我怎樣才能在PHP中向他展示他的數據?登錄後顯示用戶數據php
<?php
include_once("connection.php");
if($_SESSION['id'])
{
$_SESSION = ['id'];
$result = mysqli_query($connection, "select * from `student` where
`id` = $_SESSION[id]");
$show=mysqli_fetch_assoc($result);
if($show)
{
echo "welcome [username]";
}
}
?>
似乎你已經回答了您自己的問題? – Stuart
現在有什麼問題? –