所以我曾经通过以下方式获得当前用户的权限:
$dbQuery_ar = "SELECT * ";
$dbQuery_ar .= "FROM users WHERE gebruikersnaam = ('$_SESSION[gebruikersnaam]')";
$result_ar = mysql_query($dbQuery_ar) or die("Couldn't get file list");
while($row = mysql_fetch_array($result_ar))
{
$rechten = "$row[rechten]"; // get access level
$_SESSION["rechten"] = "$rechten"; // make session variables
}
有人可以告诉我如何编写包括会话用户名的 pdo 查询吗?