My website in hosting when I'm trying to run this code, contents are disappearing, What's wrong with this code? Any alternative way to display the result of the code below?
<?php
session_start();
$db = mysqli_connect('localhost', '******', '*******', '********'); //db connection is correct
$sql = "SELECT name, email FROM users WHERE username = '" . $_SESSION['username'] . "' ";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
echo "Hello, " . $row['name'] . " (" . $row['email'] . ").";
?>