<div class="content">
<h1>User Information</h1>
<p>hi</p>
<?php
session_start();
require_once 'dbconnect.php';
$query = $DBcon->query("SELECT username, email, password, admin FROM tbl_users ");
while($row=$query->fetch_array()){
echo'
<div id="box">
<div class="box-top">$row['username']</div>
<div class="box-panel">
<p>$row['email']</p>
<p>$row['password']</p>
<p>$row['admin']</p>
</div>
</div>
';
}
?>
</div>
This is my code to echo a block of html.
What i am doing is that i am trying to connect this php to mysql database and print out the record in appropriate place. The dbconnect.php is for database connection which has been checked to be working fine.
I am getting this in my localhost website (I dismissed all css style and other appearance setting here).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
User Information
hi
query("SELECT username, email, password, admin FROM tbl_users "); while($row=$query->fetch_array()){ echo <<< EOT $row['username'] $row['email']
$row['password']
$row['admin']
EOT; } ?>