title: DIV tag creating new line in php
body: <p>I am trying to style results from database but when I echo <code>&lt;div&gt;</code> it is creating new line after each result. How can I force the div not to create a new line?</p>
  
  <pre><code>.message {
      border:2px solid;
      background-color:white;
  }
  </code></pre>
  
  <p>php</p>
  
  <pre><code>$user = $_SESSION['username'];
  $mydb = new mysqli('localhost', 'root', '', '');
  $stmt = $mydb-&gt;prepare("SELECT * FROM messages where from_user = ?  ");
  $stmt-&gt;bind_param('s', $user);
  $stmt-&gt;execute();
  
  $result = $stmt-&gt;get_result();
  while ($row = $result-&gt;fetch_assoc()) {
      echo"&lt;div class='message'&gt;";
  
      echo $row['to_user'];
  
      echo"&lt;/div&gt;";
  }
  </code></pre>