当一个人登录时,只有他可以看到他的个人数据。我怎样才能在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
现在有什么问题? –