title: How to display user-specific content based on which user is logged in
body: <p>My site has a login feature which only requires a user enter their email. If they're email is in my MySQL database, they are granted access to a private php page (results.php). I'm trying to develop a method of identifying which user is logged in, and depending who it is, display particular content within that page.
  I'd like this <code>results.php</code> file to dynamically change its content (html) depending which user is logged in/viewing it.</p>
  
  <p>The content within <code>results.php</code> is essentially 3<code>div</code> columns, with each column containing a list of <code>a</code> links in <code>li</code> tags that I manually find and add. <strong>Please note:</strong> The amount of list items vary greatly per user. Let's say a user logs in with "hello@example.com". They have submitted keywords to me on a previous page, which allows me to compile a unique list of URLs just for them, like so:</p>
  
  <p><img src="https://i.stack.imgur.com/CZReu.png" alt="enter image description here"></p>
  
  <p>There could be up to 100 items!</p>
  
  <p><strong>My question:</strong> How do I display the content (html) that is associated with the user currently logged in? If the unique content consisted only of a few values, I understand you'd simply extract the data from MySQL. But when I'm dealing with potentially lengthy lists of unique URLs, I don't see how to store/extract an entire html file as a variable, or the proper approach. Can you shed some light?</p>
  
  <p>Here's PHP that tries to extract 'html' .. to illustrate my faulty logic:</p>
  
  <pre><code> &lt;?php
         $emailaddress = $_POST["email"];
            session_start();
         $_SESSION["email_address"] = $emailaddress;
  
          require("common.php"); 
          if(!empty($_POST)) 
          { 
              $query = " 
                  SELECT 
                      html 
                  FROM users 
                  WHERE 
                      email = :email 
              "; 
               $query_params = array( 
              ':email' =&gt; $emailaddress
          ); 
  </code></pre>
  
  <p>and here's a sample of the list items:</p>
  
  <pre><code>                   &lt;li&gt;
                         Creative Design, Colorful 
                      &lt;input id="cbox" type="checkbox" name="cbox"  /&gt;                  
                     &lt;/li&gt;
                       &lt;li&gt;
                         Cheerful People Walking, Bright Sun 
                      &lt;input id="cbox" type="checkbox" name="cbox"  /&gt;               
                     &lt;/li&gt;
  </code></pre>
  
  <p>Thanks a lot!</p>