Php print format or print php value to html scope <p>hello i am new in php and im trying to print some values from my sql table to an article in html i use article because this is the structure i need . as you will see bellow i basically want to take the path and the username from my sql table and print them to my article any suggestions?</p> <pre><code>&lt;html &gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;title&gt;Corporate 1&lt;/title&gt; &lt;link href="css/bootstrap.min.css" rel="stylesheet"&gt; &lt;link href="css/custom.css" rel="stylesheet"&gt; &lt;/head&gt; &lt;body&gt; &lt;!-- Navigation --&gt; &lt;nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"&gt; &lt;div class="container"&gt; &lt;!-- Logo and responsive toggle --&gt; &lt;div class="navbar-header"&gt; &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"&gt; &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/button&gt; &lt;a class="navbar-brand" href="#"&gt; &lt;span class="glyphicon glyphicon-fire"&gt;&lt;/span&gt; Logo &lt;/a&gt; &lt;/div&gt; &lt;!-- Navbar links --&gt; &lt;div class="collapse navbar-collapse" id="navbar"&gt; &lt;ul class="nav navbar-nav"&gt; &lt;li class="active"&gt; &lt;a href="#"&gt;Home&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="#"&gt;About&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="#"&gt;Products&lt;/a&gt; &lt;/li&gt; &lt;li class="dropdown"&gt; &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"&gt;Services &lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt; &lt;ul class="dropdown-menu" aria-labelledby="about-us"&gt; &lt;li&gt;&lt;a href="#"&gt;Engage&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Pontificate&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Synergize&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;!-- Search --&gt; &lt;form class="navbar-form navbar-right" role="search"&gt; &lt;div class="form-group"&gt; &lt;input type="text" class="form-control"&gt; &lt;/div&gt; &lt;button type="submit" class="btn btn-default"&gt;Search&lt;/button&gt; &lt;/form&gt; &lt;/div&gt; &lt;!-- /.navbar-collapse --&gt; &lt;/div&gt; &lt;!-- /.container --&gt; &lt;/nav&gt; &lt;div class="jumbotron feature"&gt; &lt;div class="container"&gt; &lt;h1&gt;&lt;span class="glyphicon glyphicon-equalizer"&gt;&lt;/span&gt;&lt;font color="#F0FFFF" style="Impact"&gt;Welcome to Aegean Community&lt;/font&gt;&lt;/h1&gt; &lt;p&gt;&lt;font color="#E9967A"&gt;Community for hope&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;a class="btn btn-default" href="LogIn.php"&gt;Engage Now&lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- Content --&gt; &lt;div class="container"&gt; &lt;!-- Heading --&gt; &lt;div class="row"&gt; &lt;div class="col-lg-12"&gt; &lt;h1 class="page-header"&gt;Superior Collaboration &lt;small&gt;Visualize Quality&lt;/small&gt; &lt;/h1&gt; &lt;p&gt;Proactively envisioned multimedia based expertise and cross-media growth strategies. Seamlessly visualize quality intellectual capital without superior collaboration and idea-sharing. Holistically pontificate installed base portals after maintainable products.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- /.row --&gt; &lt;!-- Feature Row --&gt; &lt;div class="row"&gt; &lt;!-- Feature Row --&gt; &lt;?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "some"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn-&gt;connect_error) { die("Connection failed: " . $conn-&gt;connect_error); } $sql = "SELECT * FROM information order by Ranking desc LIMIT 3 "; $result = $conn-&gt;query($sql); if ($result-&gt;num_rows &gt; 0) { // output data of each row while ($row = $result-&gt;fetch_assoc()) { ?&gt; &lt;article class="col-md-4 article-intro"&gt; &lt;a href="#"&gt; &lt;img class="img-responsive img-rounded" src=" &lt;?php echo $row['imgagePath'] ?&gt;" alt=""&gt; &lt;/a&gt; &lt;h3&gt; &lt;a href="#"&gt; &lt;?php echo $row['username'] ?&gt;&lt;/a&gt; &lt;/h3&gt; &lt;/article&gt; &lt;?php } ?&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>