我写的php
$query = "SELECT privilege , no, userName FROM $tableName WHERE userName =
'$inputAccount' and password = '$inputPassword'";
$result = $mysqli->query($query);
if($result){
while ($row = $result->fetch_assoc()) {
printf ("%s %s %s\n", $row["privilege"], $row["no"], $row["userName"]);
}
}
结果是user 2 test
session_start();
$_SESSION["privilege"]=$row["privilege"];
$_SESSION["no"]=$row["no"];
$_SESSION["userName"]=$row["userName"]
echo $_SESSION["privilege"] ;
echo $_SESSION["no"];
echo $_SESSION["userName"];
但是结果一无所获,我已经修复了很长时间,但找不到原因?
提前谢谢。