title: Generating PDF report in PHP and by using fpdf
body: <p>I am presently working on the Report generation in PHP, which I found fpdf can help me out with the same. I would like to know how to display the current logged-in user details from the database on the pdf generated. Even if you could share with me any specific link pertaining to this.</p>
  
  <p>My code to check if user is logged in</p>
  
  <pre><code>&lt;?php if(isset($_SESSION['user_logged_in'])) 
  { 
  $get_name=mysql_query("select * from mep_users where us_email='".$_SESSION['user_logged_in']."'")or die("error appeared"); while($get_nammer=mysql_fetch_array($get_name)) 
  { ?&gt; &lt;?php echo ' | '.$get_nammer['us_name']. " @ My Eye Prescription"; ?&gt; &lt;?php } } ?&gt;
  </code></pre>
  
  <p>This is the query to retrieve the value that is stored in database table mep_user_content. I can see the record in the pdf file pertaining to id 17. But I would like to see the record entered by the user i.e. the new user logging in or the guest user with the respective id. Thanks.</p>
  
  <pre><code>$pdf-&gt;AddCol('rs',40,'Right Eye');
  $prop=array('HeaderColor'=&gt;array(255,150,100),
              'color1'=&gt;array(210,245,255),
              'color2'=&gt;array(255,255,210),
              'padding'=&gt;2);
  $pdf-&gt;Table('select rs from mep_user_content where us_id="17"',$prop);
  </code></pre>