因此,从代码中您可以看到它应该回显存储在包含 php 文件中的点和用户名值。嗯...不是,我很沮丧!有什么我做错了还是没有得到?
配置文件
$username = $_SESSION['username'];
$result = mysqli_query($connection, "SELECT points FROM users WHERE username = '$username'");
$row = mysqli_fetch_assoc($result);
$points = $row['points'];
索引.php
<?php include('config.php'); ?>
<div id="container">
<?php echo $points . $username; ?>
</div>