title: Trying to retrieve users profile picture from mysql database.
body: <p>I'm having an issue trying to retrieve the users profile link that is stored in MYSQL database. </p>
  
  <p>I tried running this code to select the userprofile (where the users profile picture link is stored) but it came up with a 500 error. </p>
  
  <pre><code>        &lt;?php
      $stmt = $DB_con-&gt;prepare('SELECT id, userprofile FROM users ');
      $stmt-&gt;execute();
  if($stmt-&gt;rowCount() &gt; 0)
  {
      while($row=$stmt-&gt;fetch(PDO::FETCH_ASSOC))
      {
          extract($row);
          ?&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/bfHdG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bfHdG.png" alt="link"></a></p>
  
  <p>The Link is stored in the userprofile column.</p>
  
  <p>HTML (function.php has the Database Info in it) :</p>
  
  <pre><code>&lt;?php 
      include('functions.php');
  
  
      if (!isAdmin()) {
          $_SESSION['msg'] = "You must log in first";
          header('location: ../login.php');
      }
  
  
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt; Admin Home&lt;/title&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="header"&gt;
          &lt;h2&gt;Admin - Home Page&lt;/h2&gt;
      &lt;/div&gt;
      &lt;div class="content"&gt;
          &lt;!-- notification message --&gt;
  
  
          &lt;!-- logged in user information --&gt;
          &lt;div class="profile_info"&gt;
              &lt;img src="uploads/&lt;?php echo $row['userprofile']; ?&gt;" class="img-rounded" width="250px" height="250px" /&gt;
  
              &lt;div&gt;
                  &lt;?php  if (isset($_SESSION['user'])) : ?&gt;
                      &lt;strong&gt;&lt;?php echo $_SESSION['user']['username']; ?&gt;&lt;/strong&gt;
  
                      &lt;small&gt;
                          &lt;i  style="color: #888;"&gt;(&lt;?php echo ucfirst($_SESSION['user']['user_type']); ?&gt;)&lt;/i&gt; 
                          &lt;br&gt;
                          &lt;a href="home.php?logout='1'" style="color: red;"&gt;logout&lt;/a&gt;
                          &amp;nbsp; &lt;a href="create_user.php"&gt; + add user&lt;/a&gt;
                      &lt;/small&gt;
  
                  &lt;?php endif ?&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
  
  
      &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Image of the test user logged in (Bigfella) </p>
  
  <p><a href="https://i.stack.imgur.com/F0hyh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F0hyh.png" alt="html"></a> </p>
  
  <p>Any Ideas on why It's not retrieving the Image link from the database? Thanks In Advance!! </p>