cannot assign return value from fetch_assoc()
<p>I write the php </p>

<pre><code>$query = "SELECT privilege , no, userName FROM  $tableName WHERE userName =   

'$inputAccount' and password = '$inputPassword'";

$result = $mysqli-&gt;query($query);

if($result){
       while ($row = $result-&gt;fetch_assoc()) {
        printf ("%s %s %s\n", $row["privilege"], $row["no"], $row["userName"]);
    }
}
</code></pre>

<p>the result is <code>user 2 test</code></p>

<pre><code>session_start();
$_SESSION["privilege"]=$row["privilege"];
$_SESSION["no"]=$row["no"];
$_SESSION["userName"]=$row["userName"]

echo $_SESSION["privilege"] ;
echo $_SESSION["no"];
echo $_SESSION["userName"];
</code></pre>

<p>but the result comes to none things and I have fix it for a long time and cannot find why?</p>

<p>Thx in advance. </p>
