title: Retrieve data from database using session variable
body: <pre><code>&lt;?php
  
  {
  session_start();
  include "dbconnect.php";
  
  $email = $_SESSION['email'];
  echo $email;
  $query = "SELECT uid FROM master WHERE emailid = '$email' ";
  $result = mysql_query($query);
  $row=mysql_fetch_array($result);
  while($row)
   {
    $uid=$row[1];
  
    echo $uid;
  
     }
  </code></pre>
  
  <p>}
  whats wrong in this code.it is giving the email but not able to retrieve uid using session variable email.
  please help</p>