Here don't know why image is not being displayed in php, I think this line has some problem.
echo '<img src="' . $row['pic'] . '">';
the full code is like this
<?php
$result = mysqli_query($con, "SELECT name, email, branch, batch, position, pic FROM users ");
while ($row = mysqli_fetch_array($result)) {
echo '<section>'
. '<header>'
. '<h2>' . $row['name'] . '</h2>'
. '<p><span class="posted">'
. '<br>'
. $row['batch']
. '<br>'
. $row['branch']
. '<br>'
. $row['email']
. '<br>'
. 'Profession:'
. $row['position']
. '</header>'
. '</section>'
. '</div>'
;
}
echo '<img src="' . $row['pic'] . '">';
?>