So I have 4 columns in my table. The first two are display name and username. The reason why I dont echo
the username is that it is a md5 string, to be more secure. So i'm trying to fetch the display name associated with the username that is logged in (the $_COOKIE["USERNAME"]
), but the $displayuser
returns an empty query. Also I'm not sure about WHERE username = {$c_user}
, the part with {$c_user}
. Any solutions?
if(isset($_COOKIE['USERNAME']))
{
$c_user = $_COOKIE["USERNAME"];
$con = mysqli_connect("localhost","root","","accounts");
$result = mysqli_query($con,"SELECT 'display name' FROM 'account_info' WHERE username = {$c_user}");
$displayuser = mysqli_query($con,$result);
echo $displayuser;
}