title: Data not echoing inside div
body: <p>I am echoing data from my database and trying to show it inside of a div that is inside of another div. But it isn't showing inside the correct div.<a href="https://i.stack.imgur.com/AVmHh.png" rel="nofollow noreferrer">The problem</a></p>
  <p>I am trying to put <code>You said:   Hello  2hrs</code> next to the name and profile pic. I can't find a problem with it. There are no errors. Can someone please help me ?</p>
  <p>messages.php:</p>
  <pre><code>&lt;div class=&quot;user_convos convos_column&quot; id=&quot;convos&quot;&gt;
      
      &lt;h4&gt;Conversations&lt;/h4&gt;
      &lt;br&gt;
  
      &lt;div class='loaded_conversations' style='position: absolute;'&gt;&lt;/div&gt;
  
  
      &lt;?php echo $message_obj-&gt;getConvos(); ?&gt;
      
  &lt;a href=&quot;messages.php?u=new&quot;&gt;New Message&lt;/a&gt;
  
  &lt;br&gt;&lt;br&gt;
  
  &lt;/div&gt;
  </code></pre>
  <p>styles.css:</p>
  <pre><code>.user_found_messages {
  
  padding-left: 10px;
  padding-top: 10px;
  height: auto;
  border-bottom: 1px solid #d9d9d9;
  }
  
  .user_found_messages:hover {
  
  background-color: #F2F2F2;
  color: #669999;
  }
  
  .user_found_messages img {
  
  height: 105px;
  float: left;
  margin-top: 1px; 
  margin-right: 5px;
   }
  </code></pre>
  <p>Message.php(class)</p>
  <pre><code>public function getLatestMessage ($userLoggedIn, $user2) {
  
      $query = $this-&gt;con-&gt;prepare('SELECT body, user_to, date FROM messages WHERE 
          user_to = ? AND user_from = ? OR user_to = ? AND user_from = ? ORDER BY id DESC LIMIT 1');
  
      $query-&gt;bind_param(&quot;ssss&quot;, $userLoggedIn, $user2, $user2, $userLoggedIn);
      $query-&gt;execute();
      //$query-&gt;bind_result($body, $user_to, $date);
      $query_result = $query-&gt;get_result();
  
       while ($row = $query_result-&gt;fetch_assoc()) {
  
          //Timeframe
          $date_time_now = date(&quot;Y-m-d H:i:s&quot;);
          $start_date = new DateTime($row['date']); //Time of post
          $end_date = new DateTime($date_time_now); //Current time
          $interval = $start_date-&gt;diff($end_date); //Difference between dates 
          if($interval-&gt;y &gt;= 1) {
              if($interval-&gt;y == 1)
                  $time_message = $interval-&gt;y . &quot;yr&quot;; //1 year ago
              else 
                  $time_message = $interval-&gt;y . &quot;yrs&quot;; //1+ year ago
          }
          else if ($interval-&gt; m &gt;= 1) {
              if($interval-&gt;d == 0) {
                  $days = &quot; ago&quot;;
              }
              else if($interval-&gt;d == 1) {
                  $days = $interval-&gt;d . &quot;d&quot;;
              }
              else {
                  $days = $interval-&gt;d . &quot;d&quot;;
              }
  
              if($interval-&gt;m == 1) {
                  $time_message = $interval-&gt;m . &quot;month&quot;;
              }
              else {
                  $time_message = $interval-&gt;m . &quot;months&quot;;
              }
  
          }
          else if($interval-&gt;d &gt;= 1) {
              if($interval-&gt;d == 1) {
                  $time_message = &quot;Yesterday&quot;;
              }
              else {
                  $time_message = $interval-&gt;d . &quot;d &quot;;
              }
          }
          else if($interval-&gt;h &gt;= 1) {
              if($interval-&gt;h == 1) {
                  $time_message = $interval-&gt;h . &quot;hr&quot;;
              }
              else {
                  $time_message = $interval-&gt;h . &quot;hrs&quot;;
              }
          }
          else if($interval-&gt;i &gt;= 1) {
              if($interval-&gt;i == 1) {
                  $time_message = $interval-&gt;i . &quot;m&quot;;
              }
              else {
                  $time_message = $interval-&gt;i . &quot;m&quot;;
              }
          }
          else {
              if($interval-&gt;s &lt; 30) {
                  $time_message = &quot;Just now&quot;;
              }
              else {
                  $time_message = $interval-&gt;s . &quot; seconds ago&quot;;
              }
          }
  
          echo $sent_by = ($row['user_to'] == $userLoggedIn) ? &quot;They said: &quot; : &quot;You said: &quot;;
          echo '&amp;nbsp;&amp;nbsp;';
          echo $body = $row['body'];
          echo '&amp;nbsp;&amp;nbsp;';
          echo $time_message ;
          echo '&amp;nbsp;&amp;nbsp;';
          echo &quot;&lt;br&gt;&quot;;
      }   
          
      //return $query;
  }
  
  //--------------------------------------------------------------------------------------------- 
  //--------------------------------------------------------------------------------------------- 
  public function getConvos () {
  
      $userLoggedIn = $this-&gt;user_obj-&gt;getUsername();
      $return_string = &quot;&quot;;
      $convos = array();
  
      $query = mysqli_query($this-&gt;con, &quot;SELECT user_to, user_from FROM messages WHERE user_to='$userLoggedIn' OR 
          user_from='$userLoggedIn' ORDER BY id DESC&quot;);
  
      while ($row = mysqli_fetch_array($query)) {
  
          $user_to_push = ($row['user_to'] != $userLoggedIn) ? $row['user_to'] : $row['user_from'];
  
          if(!in_array($user_to_push, $convos)) {
  
              array_push($convos, $user_to_push);
  
          }
      }
  
      foreach ($convos as $username) {
  
          $user_found_obj = new User($this-&gt;con, $username);
          $latest_message_details = $this-&gt;getLatestMessage($userLoggedIn, $username);
  
          $dots = (strlen($latest_message_details[1]) &gt;= 12) ? &quot;...&quot; : &quot;&quot;;
          $split = str_split($latest_message_details[1], 12);
          $split = $split[0] . $dots;
  
          $return_string .= &quot;&lt;a href='messages.php?u=$username'&gt;&lt;div class='user_found_messages'&gt;
                          &lt;img src='&quot; . $user_found_obj-&gt;getProfilePic() . 
                          &quot;' style='border-radius: 5px; margin-right: 5px;'&gt; 
                          &quot;. $user_found_obj-&gt;getFirstAndLastName() . &quot;
                          &lt;span class='timestamp_smaller' id='grey'&gt; &quot; . $latest_message_details[2] . &quot;&lt;/span&gt;
                          &lt;p id='grey' style='margin-right: 10px;'&gt; &quot; . $latest_message_details[0] . $split . &quot; &lt;/p&gt;
                          &lt;/div&gt;&lt;/a&gt;&quot;;
      }
  
      return $return_string;
  }
  </code></pre>