Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个查看结果页面,在登录并添加详细信息后,用户可以查看他或她的个人资料信息。但问题是查看结果显示所有数据库条目都包括用户..我不希望它出现在哪里。我希望唯一的活跃用户条目。以下代码是否足够?或者我给出整个代码
$result=mysql_query("SELECT * FROM users ORDER BY name DESC");
我建议您了解更多关于 SQL 的奥秘。
$result = mysql_query( "SELECT * FROM users WHERE activeuser='Swati' ORDER BY name DESC" );
您需要一个WHERE声明,例如WHERE UserID=$_SESSION['UserID']
WHERE
WHERE UserID=$_SESSION['UserID']